Skip to content

Commit

Permalink
Preložené hlášky do slovenčiny (#375)
Browse files Browse the repository at this point in the history
Co-authored-by: vikibrezinova <[email protected]>
  • Loading branch information
kovacspe and vikibrezinova authored Apr 14, 2024
1 parent 11b603f commit 081f99c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions competition/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,17 +365,17 @@ def upload_solutions_with_points(self, request, pk=None):
"""Nahrá .zip archív s opravenými riešeniami (pdf-kami)."""

if 'file' not in request.data:
raise exceptions.ParseError(detail='No file attached')
raise exceptions.ParseError(detail='Žiaden súbor nebol pripojený')

zfile = request.data['file']

if not zipfile.is_zipfile(zfile):
raise exceptions.ParseError(
detail='Attached file is not a zip file')
detail='Priložený súbor nie je zip')

with zipfile.ZipFile(zfile) as zfile:
if zfile.testzip():
raise exceptions.ParseError(detail='Zip file is corrupted')
raise exceptions.ParseError(detail='Súbor zip je poškodený')

parsed_filenames = []
errors = []
Expand All @@ -394,20 +394,21 @@ def upload_solutions_with_points(self, request, pk=None):
except (IndexError, ValueError, AssertionError):
errors.append({
'filename': filename,
'status': 'Cannot parse file'
'status': 'Nedá sa prečítať názov súboru. Skontroluj, že názov súboru'
'je v tvare BODY-MENO-ID_ULOHY-ID_REGISTRACIE_USERA.pdf'
})
continue
except EventRegistration.DoesNotExist:
errors.append({
'filename': filename,
'status': f'User registration with id {registration_pk} does not exist'
'status': f'Registrácia používateľa s id {registration_pk} neexistuje'
})
continue
except Solution.DoesNotExist:
errors.append({
'filename': filename,
'status': f'Solution with registration id {registration_pk}'
f'and problem id {problem_pk} does not exist'
'status': f'Riešenie pre registráciu používateľa s id {registration_pk}'
f'a úlohy id {problem_pk} neexistuje'
})
continue

Expand Down

0 comments on commit 081f99c

Please sign in to comment.