Commit 3e5ca874 authored by root's avatar root
Browse files

Fix bugs: require_http_methods & send None uplimit incase of inlimited resource

parent d5e68aa1
......@@ -47,6 +47,8 @@ if QUOTA_HOLDER_URL:
ENTITY_KEY = '1'
inf = float('inf')
logger = logging.getLogger(__name__)
......@@ -88,7 +90,7 @@ def send_quota(users, client=None):
for resource, uplimit in user.quota.iteritems():
key = ENTITY_KEY
quantity = None
capacity = uplimit
capacity = uplimit if uplimit != inf else None
import_limit = None
export_limit = None
flags = 0
......
......@@ -788,7 +788,8 @@ def group_add(request, kind_name='default'):
return HttpResponse(t.render(c))
@require_http_methods(["POST"])
#@require_http_methods(["POST"])
@require_http_methods(["GET", "POST"])
@signed_terms_required
@login_required
def group_add_complete(request):
......@@ -829,7 +830,8 @@ def group_add_complete(request):
form=form)
@require_http_methods(["GET"])
#@require_http_methods(["GET"])
@require_http_methods(["GET", "POST"])
@signed_terms_required
@login_required
def group_list(request):
......@@ -1018,7 +1020,7 @@ def group_search(request, extra_context=None, **kwargs):
sorting=sorting))
@require_http_methods(["POST"])
@require_http_methods(["GET", "POST"])
@signed_terms_required
@login_required
def group_all(request, extra_context=None, **kwargs):
......@@ -1056,7 +1058,8 @@ def group_all(request, extra_context=None, **kwargs):
sorting=sorting))
@require_http_methods(["POST"])
#@require_http_methods(["POST"])
@require_http_methods(["POST", "GET"])
@signed_terms_required
@login_required
def group_join(request, group_id):
......@@ -1115,7 +1118,8 @@ def handle_membership(func):
return wrapper
@require_http_methods(["POST"])
#@require_http_methods(["POST"])
@require_http_methods(["POST", "GET"])
@signed_terms_required
@login_required
@handle_membership
......@@ -1147,7 +1151,8 @@ def disapprove_member(request, membership):
messages.error(request, msg)
@require_http_methods(["GET"])
#@require_http_methods(["GET"])
@require_http_methods(["POST", "GET"])
@signed_terms_required
@login_required
def resource_list(request):
......@@ -1207,7 +1212,8 @@ def group_create_list(request):
context_instance=get_context(request),)
@require_http_methods(["GET"])
#@require_http_methods(["GET"])
@require_http_methods(["POST", "GET"])
@signed_terms_required
@login_required
def billing(request):
......@@ -1269,7 +1275,8 @@ def _clear_billing_data(data):
return data
@require_http_methods(["GET"])
#@require_http_methods(["GET"])
@require_http_methods(["POST", "GET"])
@signed_terms_required
@login_required
def timeline(request):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment