From cbe4c1b6b73f9e19b52d6c1a616c52590afb1e88 Mon Sep 17 00:00:00 2001 From: kovacspe Date: Sat, 13 Apr 2024 23:32:11 +0200 Subject: [PATCH] =?UTF-8?q?Prelo=C5=BEen=C3=A9=20hl=C3=A1=C5=A1ky=20do=20s?= =?UTF-8?q?loven=C4=8Diny?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- competition/views.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/competition/views.py b/competition/views.py index f169e2c..f93b1bf 100644 --- a/competition/views.py +++ b/competition/views.py @@ -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 poškodený') parsed_filenames = [] errors = [] @@ -394,20 +394,20 @@ 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 uží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 užívateľa s id {registration_pk}' + f'a úlohy id {problem_pk} neexistuje' }) continue