mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-11 04:07:48 +03:00
Make 'duplicate_username' message translatable
Added ugettext_lazy and used it on the 'duplicate_username' message
This commit is contained in:
parent
ee2bb3f2ef
commit
0d1cfe548c
|
@ -3,7 +3,7 @@ from django.contrib import admin
|
|||
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
|
||||
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
|
||||
from .models import User
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
class MyUserChangeForm(UserChangeForm):
|
||||
|
||||
|
@ -14,7 +14,7 @@ class MyUserChangeForm(UserChangeForm):
|
|||
class MyUserCreationForm(UserCreationForm):
|
||||
|
||||
error_message = UserCreationForm.error_messages.update(
|
||||
{"duplicate_username": "This username has already been taken."}
|
||||
{"duplicate_username": _("This username has already been taken.")}
|
||||
)
|
||||
|
||||
class Meta(UserCreationForm.Meta):
|
||||
|
|
Loading…
Reference in New Issue
Block a user