Commit 2b3f5616 authored by Michal Čihař's avatar Michal Čihař

Simplify code

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 635596dd
......@@ -149,18 +149,18 @@ class TranslationViewSet(MultipleFieldMixin, FileExportViewSet):
if request.method == 'GET':
fmt = self.format_kwarg or request.query_params.get('format')
return download_translation_file(obj, fmt)
elif request.method in ('PUT', 'POST'):
if (not can_upload_translation(request.user, obj) or
obj.is_locked(request.user)):
raise PermissionDenied()
ret, count = obj.merge_upload(
request,
request.data['file'],
False
)
return Response(data={'result': ret, 'count': count})
if (not can_upload_translation(request.user, obj) or
obj.is_locked(request.user)):
raise PermissionDenied()
ret, count = obj.merge_upload(
request,
request.data['file'],
False
)
return Response(data={'result': ret, 'count': count})
class LanguageViewSet(viewsets.ReadOnlyModelViewSet):
......
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