mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-07-13 01:22:25 +03:00
Merge pull request #1694 from delneg/patch-2
Make 'duplicate_username' message translatable
This commit is contained in:
commit
a183a8181d
|
@ -162,6 +162,7 @@ Listed in alphabetical order.
|
||||||
Will Farley `@goldhand`_ @g01dhand
|
Will Farley `@goldhand`_ @g01dhand
|
||||||
William Archinal `@archinal`_
|
William Archinal `@archinal`_
|
||||||
Yaroslav Halchenko
|
Yaroslav Halchenko
|
||||||
|
Denis Bobrov `@delneg`_
|
||||||
========================== ============================ ==============
|
========================== ============================ ==============
|
||||||
|
|
||||||
.. _@a7p: https://github.com/a7p
|
.. _@a7p: https://github.com/a7p
|
||||||
|
@ -265,7 +266,7 @@ Listed in alphabetical order.
|
||||||
.. _@brentpayne: https://github.com/brentpayne
|
.. _@brentpayne: https://github.com/brentpayne
|
||||||
.. _@afrowave: https://github.com/afrowave
|
.. _@afrowave: https://github.com/afrowave
|
||||||
.. _@pchiquet: https://github.com/pchiquet
|
.. _@pchiquet: https://github.com/pchiquet
|
||||||
|
.. _@delneg: https://github.com/delneg
|
||||||
Special Thanks
|
Special Thanks
|
||||||
~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ from django.contrib import admin
|
||||||
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
|
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
|
||||||
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
|
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
|
||||||
from .models import User
|
from .models import User
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class MyUserChangeForm(UserChangeForm):
|
class MyUserChangeForm(UserChangeForm):
|
||||||
|
@ -14,7 +15,7 @@ class MyUserChangeForm(UserChangeForm):
|
||||||
class MyUserCreationForm(UserCreationForm):
|
class MyUserCreationForm(UserCreationForm):
|
||||||
|
|
||||||
error_message = UserCreationForm.error_messages.update(
|
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):
|
class Meta(UserCreationForm.Meta):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user