X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/37ef9073a6d8676a5c2cb0f3cf4105c60af77469..04b05946ab640eaf9135a73772b704dd41c323e7:/apps/api/utils.py diff --git a/apps/api/utils.py b/apps/api/utils.py index f6d9b1b5..19309ff6 100644 --- a/apps/api/utils.py +++ b/apps/api/utils.py @@ -35,7 +35,7 @@ def validate_form(formclass, source='GET'): def decorator(func): @wraps(func) - def decorated(self, request, * args, ** kwargs): + def decorated(self, request, *args, **kwargs): form = formclass(getattr(request, source), request.FILES) if not form.is_valid(): @@ -65,8 +65,8 @@ def natural_order(get_key=lambda x: x): def getter(key): nkey = get_key(key) - if not isinstance(key, unicode): - ukey = key.decode('utf-8') + if not isinstance(nkey, unicode): + ukey = nkey.decode('utf-8') else: ukey = nkey