Free and open source ticket system written in python

fix error messages on username field and missing i18n ref

+24 -15
+6 -6
core/forms.py
··· 28 28 max_length=50, 29 29 regex=r'^[a-zA-Z0-9-_@]+$', 30 30 error_messages={ 31 - 'required': _('Please enter your name'), 32 - 'invalid': _('Alphanumeric characters and underscores and dashes only (a-z, 0-9, _, -, @)') 31 + 'required': _('Please enter a username'), 32 + 'invalid': _('Username can only have alphanumeric characters and underscores and dashes (a-z, 0-9, _, -, @)') 33 33 }, 34 34 widget=forms.TextInput( 35 35 attrs={'placeholder': _('Username'), 'class': 'input input-bordered w-full'}), ··· 55 55 56 56 if password != password_confirm: 57 57 raise forms.ValidationError( 58 - "password and password_confirm does not match" 58 + "Password and Confirm Password do not match." 59 59 ) 60 60 if len(password) < 10: 61 61 raise forms.ValidationError( 62 - "password must be at least 10 characters long" 62 + "Password must be at least 10 characters long." 63 63 ) 64 64 65 65 if PawUser.objects.filter(username=cleaned_data.get("username")).exists(): 66 66 raise forms.ValidationError( 67 - "An account with this username already exists" 67 + "An account with this username already exists." 68 68 ) 69 69 if PawUser.objects.filter(email=cleaned_data.get("email")).exists(): 70 70 raise forms.ValidationError( 71 - "An account with this email already exists" 71 + "An account with this email already exists." 72 72 ) 73 73 return cleaned_data 74 74
+1 -1
paw/__init__.py
··· 1 1 from django import get_version 2 2 3 - VERSION = (0, 5, 8, "final", 0) 3 + VERSION = (0, 5, 9, "final", 0) 4 4 5 5 __version__ = get_version(VERSION)
+10 -6
paw/templates/core/account_finish.html
··· 10 10 <h1 class="text-3xl font-bold p-2">{% trans 'Register a new account' %}</h1> 11 11 <div class="bg-base-200 rounded p-8"> 12 12 <ul class="steps w-full mb-6"> 13 - <li class="step step-accent">{% trans 'Authenticate' %}</li> 14 - <li class="step step-accent">{% trans 'Set up account' %}</li> 15 - <li class="step step-success">{% trans 'Done' %}</li> 16 - </ul> 13 + <li class="step step-accent">{% trans 'Authenticate' %}</li> 14 + <li class="step step-accent">{% trans 'Set up account' %}</li> 15 + <li class="step step-success">{% trans 'Done' %}</li> 16 + </ul> 17 17 <form method="post"> 18 18 {% csrf_token %} 19 19 20 - {% if form.non_field_errors %} 20 + {% if form.errors %} 21 21 <div role="alert" class="alert alert-error mb-4"> 22 22 <svg xmlns="http://www.w3.org/2000/svg" class="hidden sm:block stroke-current shrink-0 h-6 w-6" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 10l4 4m0 -4l-4 4" /><path d="M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z" /></svg> 23 - <span>{{ form.non_field_errors }}</span> 23 + <ul> 24 + {% for error in form.non_field_errors|add:form.username.errors %} 25 + <li>{{ error }}</li> 26 + {% endfor %} 27 + </ul> 24 28 </div> 25 29 {% endif %} 26 30
+6 -2
paw/templates/core/register.html
··· 8 8 <form method="post"> 9 9 {% csrf_token %} 10 10 11 - {% if form.non_field_errors %} 11 + {% if form.errors %} 12 12 <div role="alert" class="alert alert-error mb-4"> 13 13 <svg xmlns="http://www.w3.org/2000/svg" class="hidden sm:block stroke-current shrink-0 h-6 w-6" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 10l4 4m0 -4l-4 4" /><path d="M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z" /></svg> 14 - <span>{{ form.non_field_errors }}</span> 14 + <ul> 15 + {% for error in form.non_field_errors|add:form.username.errors %} 16 + <li>{{ error }}</li> 17 + {% endfor %} 18 + </ul> 15 19 </div> 16 20 {% endif %} 17 21
+1
paw/templates/partials/ticket_priority_badge.html
··· 1 1 {% block ticket_priority_badge %} 2 + {% load i18n %} 2 3 {% if ticket.priority == 3 %} 3 4 <span class="badge badge-success join-item">{% trans 'Low' %}</span> 4 5 {% elif ticket.priority == 2 %}