diff --git a/competition/views.py b/competition/views.py index 67faa286..ea1cf4a9 100644 --- a/competition/views.py +++ b/competition/views.py @@ -266,7 +266,7 @@ def upload_model_solution(self, request, pk=None): """Nahrá užívateľské riešenie k úlohe""" problem: Problem = self.get_object() if 'file' not in request.FILES: - raise exceptions.ParseError(detail='Request neobsahoval súbor') + raise exceptions.ParseError(detail='Požiadávka neobsahovala súbor') file = request.FILES['file'] if mime_type(file) != 'application/pdf': raise exceptions.ParseError( @@ -338,17 +338,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='Nie je priložený súbor') 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 súbor s príponou 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 = [] @@ -367,20 +367,20 @@ def upload_solutions_with_points(self, request, pk=None): except (IndexError, ValueError, AssertionError): errors.append({ 'filename': filename, - 'status': 'Cannot parse file' + 'status': 'Nie je možné analyzovať súbor' }) 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 s registračným id {registration_pk}' + f'a id úlohy {problem_pk} neexistuje' }) continue @@ -518,7 +518,7 @@ def file_corrected(self, request, pk=None): def upload_solution_file(self, request, pk=None): solution: Solution = self.get_object() if 'file' not in request.FILES: - raise exceptions.ParseError(detail='Request neobsahoval súbor') + raise exceptions.ParseError(detail='Požiadávka neobsahovala súbor') file = request.FILES['file'] if mime_type(file) != 'application/pdf': @@ -535,7 +535,7 @@ def upload_solution_file(self, request, pk=None): def upload_corrected_solution_file(self, request, pk=None): solution: Solution = self.get_object() if 'file' not in request.FILES: - raise exceptions.ParseError(detail='Request neobsahoval súbor') + raise exceptions.ParseError(detail='Požiadávka neobsahovala súbor') file = request.FILES['file'] if mime_type(file) != 'application/pdf': @@ -830,7 +830,7 @@ def download_publication(self, request, pk=None): def upload_publication(self, request): """Nahrá súbor publikácie""" if 'file' not in request.data: - raise exceptions.ParseError(detail='Request neobsahoval súbor') + raise exceptions.ParseError(detail='Požiadavka neobsahovala súbor') file = request.data['file'] if mime_type(file) not in ['application/pdf', 'application/zip']: diff --git a/user/serializers.py b/user/serializers.py index b88445b6..e4f9cab5 100644 --- a/user/serializers.py +++ b/user/serializers.py @@ -39,7 +39,7 @@ def get_auth_user(self, email, password): def validate_auth_user_status(self, user): if not user.is_active: - msg = 'User nie je aktívny' + msg = 'Používateľ nie je aktívny' raise exceptions.ValidationError(msg) def validate_email_verification_status(self, user): @@ -177,7 +177,7 @@ def validate_email(self, email): email = get_adapter().clean_email(email) if email and EmailAddress.objects.filter(email__iexact=email).exists(): raise serializers.ValidationError( - "Entered email adress is already used! Please try again with another email adress.") + "Zadaná emailová adresa je už používaná. Prosíme skús vyskúsať inú emailovú adresu.") return email def validate_password1(self, password): @@ -189,18 +189,18 @@ def validate_profile(self, profile): ''' if not profile['gdpr']: raise serializers.ValidationError( - 'You have to confirm, that you are aware of the processing of personal data.') + 'Musíš podvrdiť, že si si vedomý spracovania osobných údajov.') return profile def validate(self, attrs): if attrs['password1'] != attrs['password2']: - raise serializers.ValidationError("Entered passwords do not match.") + raise serializers.ValidationError("Zadané heslá sa nezhodujú.") # ak je zadana skola "ina skola", musi byt nejaky description skoly if (attrs['profile']['school'].code == self.OTHER_SCHOOL_CODE and len(attrs['new_school_description']) == 0): raise serializers.ValidationError( - 'You must enter a description of your school.') + 'Musíš zadať popis tvojej školy.') return attrs