Improve import error messages

This commit is contained in:
Jan-Niklas Weghorn
2023-11-10 13:28:20 +01:00
parent 8a588db429
commit 3c08e3a3f1
5 changed files with 21 additions and 8 deletions

View File

@ -1454,7 +1454,7 @@ def import_files(request):
"""
limit, msg = above_space_limit(request.space)
if limit:
return Response({'error': msg}, status=status.HTTP_400_BAD_REQUEST)
return Response({'error': True, 'msg': _('File is above space limit')}, status=status.HTTP_400_BAD_REQUEST)
form = ImportForm(request.POST, request.FILES)
if form.is_valid() and request.FILES != {}: