From ac9431047765a660d70ab374ad2eb93ac824095b Mon Sep 17 00:00:00 2001 From: chani hoffman Date: Thu, 23 Nov 2017 13:44:33 +0200 Subject: [PATCH 1/9] translations for hebrew --- .../locale/heb/LC_MESSAGES/django.mo | Bin 0 -> 3182 bytes .../locale/heb/LC_MESSAGES/django.po | 151 ++++++++++++++++++ 2 files changed, 151 insertions(+) create mode 100644 password_reset/locale/heb/LC_MESSAGES/django.mo create mode 100644 password_reset/locale/heb/LC_MESSAGES/django.po diff --git a/password_reset/locale/heb/LC_MESSAGES/django.mo b/password_reset/locale/heb/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..27e9353fe2d5ff668234d6acd86fa83caf0be36d GIT binary patch literal 3182 zcmb7FOK%%h6ds^F>Xuh|ONE|R1Y$MgJPM+69yFwG8v&NFp9uo;4a_|;Df;LfDZs~0!M(~1K$H~$Kp<4 z8Tc%)27Che3GhkaDsT_*n`r-M;8U3Y0c5+sfoFj`wuN@}2$z6QWBps;Bfy`4?C%%g zJHS7IuLIu%xn5umcnY`%{1CbP1N<2C#>0m3C~zB`Fwb4U?Z7?25nvj)3akK`*A8s% z=Y8Nyz~jK@fMOR3Ngl%kY5{l7gSqg4Y(XBZ3G4nmp5%B46S#;6%4L8;JeW&s zaGhCeNEQr8Wcp^naAFRcf$je!w z8h5UcbRkPYLJK#ox7g>B7?a_7sx)FrjVWZ7)YzDkN;SH|gj(4mGAj_)N25fumSYz( zbQ)6SEf;BWvI7>Cl_(DG>*#DTeZQuhwB9$Q#0NE@TlJK#80fZ!GHtQAUeH}=R$iR5 zwU;rb(G*@?#%whe>;mssEH7Wq7$;q8#({~Xq7BvA1s0>`h+jx53cG~)nkLV+tO(Gc zsuG@X3$|NgFEc?;ut^zh9FZ0UwBc<^w8@<@VjWs-l2nvt8dQ{yBkMsFZWIbI^-3Lbze6HcJCdxEqySDx=V{&Ycq6HCe(&y1NX7(KD>4Bj+DQ0bU9@(AF4Nsb5{; z6w1uGdC4u5rGqoJmzr>D%5uyjQdM-8+-fk@gMIxJz7BS}w0Dqt)BP#KpYxafi+Gm( z74k3p>;8(rL<8M3Y6uJW_<+Lh8tj+jFKLGSCXR2w+q%C<{=B~ir+D>m5TNB6=Q!jw ztY6_1S1`GPGfkuYvzjDk;QR^>tafd_CAjgm3%|yRFD>FPapc%PVZH!IO#@q;@q*tZ zIAu1MnC=b#I;NNX3;rr098+HOHwXs!X}Q@5x36J)(Lc`#Z1`7UeUVc}7D?K?`?=o? zglU~e$PJvGV`>+m!ZK^q1cf=CU-dVPI224{#!ZO1;xDiM0N+w+`V zB5Lev9p{(8E2v9sz`|~|jzEd;`dy7KV+W06;AeeH?@j+R2!5A(%(2ug-*wQwib5=N z3FiDSXtRgHtUl=&DcPa=F zUYIRIp#F;y , 2017. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-23 22:24-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Michael Mash \n" +"Language-Team: ES \n" +"Language: ES\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: forms.py:26 +msgid "Username" +msgstr "שם משתמש" + +#: forms.py:27 +msgid "Email" +msgstr "אימייל" + +#: forms.py:28 +msgid "Username or Email" +msgstr "שם משתמש או אימייל" + +#: forms.py:48 forms.py:58 forms.py:70 +msgid "Sorry, this user doesn't exist." +msgstr "שם משתמש אינו קיים" + +#: forms.py:72 +msgid "Unable to find user." +msgstr "לא נמצא שם משתמש" + +#: forms.py:78 +msgid "New password" +msgstr "סיסמה חדשה" + +#: forms.py:82 +msgid "New password (confirm)" +msgstr "הקלד שנית לאימות הסיסמה" + +#: forms.py:94 +msgid "The two passwords didn't match." +msgstr "הסיסמאות אינן תואמות" + +#: templates/password_reset/recovery_done.html:3 +msgid "New password set" +msgstr "נקלטה סיסמה חדשה" + +#: templates/password_reset/recovery_done.html:6 +msgid "" +"Your password has successfully been reset. You can use it right now on the " +"login page." +msgstr "" +"הסיסמה שלך הוגדרה בהצלחה. אתם יכולים להשתמש בה כעת בדף הכניסה " + +#: templates/password_reset/recovery_email.txt:1 +#, python-format +msgid "Dear %(username)s," +msgstr "%(username)s," + +#: templates/password_reset/recovery_email.txt:3 +#, python-format +msgid "" +"You -- or someone pretending to be you -- has requested a password reset on " +"%(domain)s." +msgstr "" +"אתם או מישהו בשמכם ביקש איפוס סיסמה ב " +"%(domain)s." + +#: templates/password_reset/recovery_email.txt:5 +msgid "You can set your new password by following this link:" +msgstr "לחצו על הקישור לאיפוס סיסמה" + +#: templates/password_reset/recovery_email.txt:9 +msgid "" +"If you don't want to reset your password, simply ignore this email and it " +"will stay unchanged." +msgstr "" +"במידה ואין ברצונכם לשנות את סיסמתכם פשוט התעלמו מהאימייל הזה. " +"הסיסמה תשאר כפי שהיא כעת""" + +#: templates/password_reset/recovery_email_subject.txt:1 +#, python-format +msgid "Password recovery on %(domain)s" +msgstr "שיחזור סיסמה ל%(domain)s" + +#: templates/password_reset/recovery_form.html:5 +msgid "Password recovery" +msgstr "שיחזור סיסמה" + +#: templates/password_reset/recovery_form.html:11 +msgid "Recover my password" +msgstr "לשחזור סיסמה" + +#: templates/password_reset/reset.html:5 +#, python-format +msgid "" +"Sorry, this password reset link is invalid. You can still request a new one." +msgstr "" +"אנו מצטערים אך קישורית זו לאיפוס סיסמה אינה תקינה. אתה יכול לבקש קישור חדש." + +#: templates/password_reset/reset.html:7 +#, python-format +msgid "Hi, %(username)s. Please choose your new password." +msgstr "שלום, %(username)s. בחר סיסמה חדשה" + +#: templates/password_reset/reset.html:11 +msgid "Set new password" +msgstr "הגדר סיסמה חדשה" + +#: templates/password_reset/reset_sent.html:4 +msgid "Password recovery sent" +msgstr "שיחזור סיסמה נשלח" + +#: templates/password_reset/reset_sent.html:7 +#, python-format +msgid "" +"An email was sent to %(email)s %(ago)s ago. Use the link in " +"it to set a new password." +msgstr "" +"אימייל נשלח
ל %(email)s לפני %(ago)s . " +"השתמשו בקישור שנשלח לאיפוס הסיסמה" + +#we suggest to replace this origin messages: + + +#: templates/password_reset/recovery_email.txt:1 +#, python-format +msgid "Hi," +msgstr "שלום," + + + +#: templates/password_reset/recovery_email.txt:3 +#, python-format +msgid "" +"You has requested a password reset on " +"%(domain)s." +msgstr "" +"ביקשת איפוס סיסמה בדומיין " +"%(domain)s." + From d38966eb89eaef2e61ed02129f6326cca174e641 Mon Sep 17 00:00:00 2001 From: chani hoffman Date: Thu, 30 Nov 2017 08:26:25 +0200 Subject: [PATCH 2/9] remove unneeded lines from translation file --- .../locale/heb/LC_MESSAGES/django.po | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/password_reset/locale/heb/LC_MESSAGES/django.po b/password_reset/locale/heb/LC_MESSAGES/django.po index 1d19054a..6b0b5e47 100644 --- a/password_reset/locale/heb/LC_MESSAGES/django.po +++ b/password_reset/locale/heb/LC_MESSAGES/django.po @@ -130,22 +130,3 @@ msgstr "" "אימייל נשלח
ל %(email)s לפני %(ago)s . " "השתמשו בקישור שנשלח לאיפוס הסיסמה" -#we suggest to replace this origin messages: - - -#: templates/password_reset/recovery_email.txt:1 -#, python-format -msgid "Hi," -msgstr "שלום," - - - -#: templates/password_reset/recovery_email.txt:3 -#, python-format -msgid "" -"You has requested a password reset on " -"%(domain)s." -msgstr "" -"ביקשת איפוס סיסמה בדומיין " -"%(domain)s." - From 463325cc14b59a38b7daba3abab8670bedc2264d Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Tue, 4 Oct 2016 09:15:04 -0400 Subject: [PATCH 3/9] Drop support for Django < 1.8 --- .travis.yml | 11 ----------- README.rst | 2 +- docs/index.rst | 4 ++++ password_reset/forms.py | 3 +-- password_reset/tests/tests.py | 31 ++++++++++--------------------- password_reset/utils.py | 12 ------------ password_reset/views.py | 11 ++++------- runtests.py | 9 ++------- setup.py | 2 +- tox.ini | 12 +++--------- 10 files changed, 26 insertions(+), 71 deletions(-) delete mode 100644 password_reset/utils.py diff --git a/.travis.yml b/.travis.yml index a830736f..4cd54962 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,20 +3,9 @@ python: "3.5" sudo: false cache: pip env: - - TOXENV=py26-django15 - - TOXENV=py26-django16 - - TOXENV=py27-django15 - - TOXENV=py27-django16 - - TOXENV=py27-django17 - TOXENV=py27-django18 - TOXENV=py27-django19 - - TOXENV=py33-django15 - - TOXENV=py33-django16 - - TOXENV=py33-django17 - TOXENV=py33-django18 - - TOXENV=py34-django15 - - TOXENV=py34-django16 - - TOXENV=py34-django17 - TOXENV=py34-django18 - TOXENV=py34-django19 - TOXENV=py35-django18 diff --git a/README.rst b/README.rst index c83082ec..07fe7727 100644 --- a/README.rst +++ b/README.rst @@ -16,7 +16,7 @@ functionality. * Author: Bruno Renié and `contributors`_ * Licence: BSD -* Compatibility: Django 1.4+ (cryptographic signing needed) +* Compatibility: Django 1.8+ .. _contributors: https://github.com/brutasse/django-password-reset/contributors diff --git a/docs/index.rst b/docs/index.rst index 0d2d13e4..1d1fbded 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -28,6 +28,10 @@ Contents: Changelog --------- +* 1.0 (TBA): + + * Drop support for Django < 1.8. + * 0.9 (2016-06-01): * Allow token expiration time to be customized with a setting. diff --git a/password_reset/forms.py b/password_reset/forms.py index 2ef1f6cb..8dc0ad1d 100644 --- a/password_reset/forms.py +++ b/password_reset/forms.py @@ -1,11 +1,10 @@ from django import forms +from django.contrib.auth import get_user_model from django.core.validators import validate_email from django.db.models import Q from django.utils.translation import ugettext_lazy as _ from django.conf import settings -from .utils import get_user_model - class PasswordRecoveryForm(forms.Form): username_or_email = forms.CharField() diff --git a/password_reset/tests/tests.py b/password_reset/tests/tests.py index b80b1dcd..065790db 100644 --- a/password_reset/tests/tests.py +++ b/password_reset/tests/tests.py @@ -1,37 +1,26 @@ -import django +from unittest import SkipTest +from django.contrib.auth import get_user_model +from django.contrib.auth.tests.custom_user import CustomUser, ExtensionUser from django.core import mail from django.core.urlresolvers import reverse from django.test import TestCase from django.test.utils import override_settings from django.utils import timezone from django.utils.six import with_metaclass -try: - from django.utils.unittest import SkipTest -except ImportError: - from unittest import SkipTest from ..forms import PasswordRecoveryForm, PasswordResetForm -from ..utils import get_user_model - -if django.VERSION >= (1, 5): - from django.contrib.auth.tests.custom_user import ( # noqa - CustomUser, ExtensionUser) -else: - CustomUser = None # noqa - ExtensionUser = None # noqa class CustomUserVariants(type): def __new__(cls, name, bases, dct): - if django.VERSION >= (1, 5): - for custom_user in ['auth.CustomUser', 'auth.ExtensionUser']: - suffix = custom_user.lower().replace('.', '_') - for key, fn in list(dct.items()): - if key.startswith('test') and '_CUSTOM_' not in key: - name = '{0}_CUSTOM_{1}'.format(key, suffix) - dct[name] = override_settings( - AUTH_USER_MODEL=custom_user)(fn) + for custom_user in ['auth.CustomUser', 'auth.ExtensionUser']: + suffix = custom_user.lower().replace('.', '_') + for key, fn in list(dct.items()): + if key.startswith('test') and '_CUSTOM_' not in key: + name = '{0}_CUSTOM_{1}'.format(key, suffix) + dct[name] = override_settings( + AUTH_USER_MODEL=custom_user)(fn) return super(CustomUserVariants, cls).__new__(cls, name, bases, dct) diff --git a/password_reset/utils.py b/password_reset/utils.py deleted file mode 100644 index b50ccd57..00000000 --- a/password_reset/utils.py +++ /dev/null @@ -1,12 +0,0 @@ -try: - from django.contrib.auth import get_user_model -except ImportError: - from django.contrib.auth.models import User - - def get_user_model(): - return User - - -def get_username(user): - username_field = getattr(user, 'USERNAME_FIELD', 'username') - return getattr(user, username_field) diff --git a/password_reset/views.py b/password_reset/views.py index 74442347..dc7642c5 100644 --- a/password_reset/views.py +++ b/password_reset/views.py @@ -1,6 +1,8 @@ import datetime from django.conf import settings +from django.contrib.auth import get_user_model +from django.contrib.sites.shortcuts import get_current_site from django.core import signing from django.core.mail import send_mail from django.core.urlresolvers import reverse, reverse_lazy @@ -12,14 +14,9 @@ from django.views import generic from django.views.decorators.debug import sensitive_post_parameters -try: - from django.contrib.sites.shortcuts import get_current_site -except ImportError: - from django.contrib.sites.models import get_current_site from .forms import PasswordRecoveryForm, PasswordResetForm from .signals import user_recovers_password -from .utils import get_user_model, get_username class SaltMixin(object): @@ -84,7 +81,7 @@ def send_notification(self): context = { 'site': self.get_site(), 'user': self.user, - 'username': get_username(self.user), + 'username': self.user.get_username(), 'token': signing.dumps(self.user.pk, salt=self.salt), 'secure': self.request.is_secure(), } @@ -154,7 +151,7 @@ def get_context_data(self, **kwargs): ctx = super(Reset, self).get_context_data(**kwargs) if 'invalid' not in ctx: ctx.update({ - 'username': get_username(self.user), + 'username': self.user.get_username(), 'token': self.kwargs['token'], }) return ctx diff --git a/runtests.py b/runtests.py index 94f8c453..8995ca54 100755 --- a/runtests.py +++ b/runtests.py @@ -4,23 +4,18 @@ import warnings import django +from django.test.runner import DiscoverRunner warnings.simplefilter('always') os.environ['DJANGO_SETTINGS_MODULE'] = 'password_reset.tests.settings' -try: - from django.test.runner import DiscoverRunner -except ImportError: - from discover_runner import DiscoverRunner - def runtests(): parent = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, parent) - if django.VERSION >= (1, 7): - django.setup() + django.setup() runner = DiscoverRunner(verbosity=1, interactive=True, failfast=bool(os.environ.get('FAILFAST'))) diff --git a/setup.py b/setup.py index df82b271..a4a47612 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ description='Class-based views for password reset.', long_description=open('README.rst').read(), install_requires=[ - 'Django>=1.4', + 'Django>=1.8', ], classifiers=[ 'Development Status :: 4 - Beta', diff --git a/tox.ini b/tox.ini index 2dcb6261..6daf3a8d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,25 +1,19 @@ [tox] envlist = - py26-django1{5,6}, - py27-django1{5,6,7,8,9}, - py33-django1{5,6,7,8}, - py34-django1{5,6,7,8,9}, + py27-django1{8,9}, + py33-django18, + py34-django1{8,9}, py35-django1{8,9}, docs, lint [testenv] commands = python -Wall setup.py test basepython = - py26: python2.6 py27: python2.7 py33: python3.3 py34: python3.4 py35: python3.5 deps = - django-discover-runner - django15: Django>=1.5,<1.6 - django16: Django>=1.6,<1.7 - django17: Django>=1.7,<1.8 django18: Django>=1.8,<1.9 django19: Django>=1.9,<1.10 From 02676acfe316d8ef429d1f639d0f66a574c9256d Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Tue, 4 Oct 2016 09:31:38 -0400 Subject: [PATCH 4/9] Add Django version trove classifiers --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index a4a47612..834f7dd5 100644 --- a/setup.py +++ b/setup.py @@ -25,6 +25,8 @@ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', + 'Framework :: Django :: 1.8', + 'Framework :: Django :: 1.9', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Natural Language :: English', From aeb6602089097cab4749875a598bd7c2a59f66a1 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Tue, 4 Oct 2016 09:36:19 -0400 Subject: [PATCH 5/9] Add testing for Django 1.10 --- .travis.yml | 3 + docs/index.rst | 2 +- password_reset/tests/models.py | 114 +++++++++++++++++++++++++++++++++ password_reset/tests/tests.py | 4 +- setup.py | 1 + tox.ini | 7 +- 6 files changed, 125 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4cd54962..3ee3ce54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,14 @@ cache: pip env: - TOXENV=py27-django18 - TOXENV=py27-django19 + - TOXENV=py27-django110 - TOXENV=py33-django18 - TOXENV=py34-django18 - TOXENV=py34-django19 + - TOXENV=py34-django110 - TOXENV=py35-django18 - TOXENV=py35-django19 + - TOXENV=py35-django110 - TOXENV=docs - TOXENV=lint install: diff --git a/docs/index.rst b/docs/index.rst index 1d1fbded..cb0adfac 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -30,7 +30,7 @@ Changelog * 1.0 (TBA): - * Drop support for Django < 1.8. + * Drop support for Django < 1.8 and confirm support for Django 1.10. * 0.9 (2016-06-01): diff --git a/password_reset/tests/models.py b/password_reset/tests/models.py index e69de29b..8265cf99 100644 --- a/password_reset/tests/models.py +++ b/password_reset/tests/models.py @@ -0,0 +1,114 @@ +from django.contrib.auth.models import ( + AbstractBaseUser, AbstractUser, BaseUserManager, Group, Permission, + PermissionsMixin, UserManager, +) +from django.db import models + + +# The custom User uses email as the unique identifier, and requires +# that every user provide a date of birth. This lets us test +# changes in username datatype, and non-text required fields. +class CustomUserManager(BaseUserManager): + def create_user(self, email, date_of_birth, password=None): + """ + Creates and saves a User with the given email and password. + """ + if not email: + raise ValueError('Users must have an email address') + + user = self.model( + email=self.normalize_email(email), + date_of_birth=date_of_birth, + ) + + user.set_password(password) + user.save(using=self._db) + return user + + def create_superuser(self, email, password, date_of_birth): + u = self.create_user( + email, password=password, date_of_birth=date_of_birth, + ) + u.is_admin = True + u.save(using=self._db) + return u + + +class CustomUser(AbstractBaseUser): + email = models.EmailField( + verbose_name='email address', + max_length=255, + unique=True, + ) + is_active = models.BooleanField(default=True) + is_admin = models.BooleanField(default=False) + date_of_birth = models.DateField() + + custom_objects = CustomUserManager() + + USERNAME_FIELD = 'email' + REQUIRED_FIELDS = ['date_of_birth'] + + def get_full_name(self): + return self.email + + def get_short_name(self): + return self.email + + def __str__(self): + return self.email + + # Maybe required? + def get_group_permissions(self, obj=None): + return set() + + def get_all_permissions(self, obj=None): + return set() + + def has_perm(self, perm, obj=None): + return True + + def has_perms(self, perm_list, obj=None): + return True + + def has_module_perms(self, app_label): + return True + + # Admin required fields + @property + def is_staff(self): + return self.is_admin + + +class RemoveGroupsAndPermissions(object): + """ + A context manager to temporarily remove the groups and user_permissions M2M + fields from the AbstractUser class, so they don't clash with the + related_name sets. + """ + def __enter__(self): + self._old_au_local_m2m = AbstractUser._meta.local_many_to_many + self._old_pm_local_m2m = PermissionsMixin._meta.local_many_to_many + groups = models.ManyToManyField(Group, blank=True) + groups.contribute_to_class(PermissionsMixin, "groups") + user_permissions = models.ManyToManyField(Permission, blank=True) + user_permissions.contribute_to_class( + PermissionsMixin, "user_permissions" + ) + PermissionsMixin._meta.local_many_to_many = [groups, user_permissions] + AbstractUser._meta.local_many_to_many = [groups, user_permissions] + + def __exit__(self, exc_type, exc_value, traceback): + AbstractUser._meta.local_many_to_many = self._old_au_local_m2m + PermissionsMixin._meta.local_many_to_many = self._old_pm_local_m2m + + +# The extension user is a simple extension of the built-in user class, +# adding a required date_of_birth field. +with RemoveGroupsAndPermissions(): + class ExtensionUser(AbstractUser): + date_of_birth = models.DateField() + + custom_objects = UserManager() + + REQUIRED_FIELDS = AbstractUser.REQUIRED_FIELDS + ['date_of_birth'] diff --git a/password_reset/tests/tests.py b/password_reset/tests/tests.py index 065790db..cad8ddaa 100644 --- a/password_reset/tests/tests.py +++ b/password_reset/tests/tests.py @@ -1,7 +1,6 @@ from unittest import SkipTest from django.contrib.auth import get_user_model -from django.contrib.auth.tests.custom_user import CustomUser, ExtensionUser from django.core import mail from django.core.urlresolvers import reverse from django.test import TestCase @@ -10,11 +9,12 @@ from django.utils.six import with_metaclass from ..forms import PasswordRecoveryForm, PasswordResetForm +from .models import CustomUser, ExtensionUser class CustomUserVariants(type): def __new__(cls, name, bases, dct): - for custom_user in ['auth.CustomUser', 'auth.ExtensionUser']: + for custom_user in ['tests.CustomUser', 'tests.ExtensionUser']: suffix = custom_user.lower().replace('.', '_') for key, fn in list(dct.items()): if key.startswith('test') and '_CUSTOM_' not in key: diff --git a/setup.py b/setup.py index 834f7dd5..2e02ba82 100644 --- a/setup.py +++ b/setup.py @@ -27,6 +27,7 @@ 'Framework :: Django', 'Framework :: Django :: 1.8', 'Framework :: Django :: 1.9', + 'Framework :: Django :: 1.10', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Natural Language :: English', diff --git a/tox.ini b/tox.ini index 6daf3a8d..f64c61b1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,9 @@ [tox] envlist = - py27-django1{8,9}, + py27-django1{8,9,10}, py33-django18, - py34-django1{8,9}, - py35-django1{8,9}, + py34-django1{8,9,10}, + py35-django1{8,9,10}, docs, lint [testenv] @@ -16,6 +16,7 @@ basepython = deps = django18: Django>=1.8,<1.9 django19: Django>=1.9,<1.10 + django110: Django>=1.10,<1.11 [testenv:docs] basepython = python3.5 From 553dfd9e3d7f685b4f724543bf737f9d25ae6df4 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 25 May 2017 10:16:09 -0400 Subject: [PATCH 6/9] Add testing for Django 1.11 --- .travis.yml | 3 +++ docs/index.rst | 2 +- password_reset/tests/settings.py | 4 +--- setup.py | 1 + tox.ini | 7 ++++--- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3ee3ce54..44967057 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,13 +6,16 @@ env: - TOXENV=py27-django18 - TOXENV=py27-django19 - TOXENV=py27-django110 + - TOXENV=py27-django111 - TOXENV=py33-django18 - TOXENV=py34-django18 - TOXENV=py34-django19 - TOXENV=py34-django110 + - TOXENV=py34-django111 - TOXENV=py35-django18 - TOXENV=py35-django19 - TOXENV=py35-django110 + - TOXENV=py35-django111 - TOXENV=docs - TOXENV=lint install: diff --git a/docs/index.rst b/docs/index.rst index cb0adfac..25bcd234 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -30,7 +30,7 @@ Changelog * 1.0 (TBA): - * Drop support for Django < 1.8 and confirm support for Django 1.10. + * Drop support for Django < 1.8 and confirm support for Django 1.10 and 1.11. * 0.9 (2016-06-01): diff --git a/password_reset/tests/settings.py b/password_reset/tests/settings.py index f7c1479b..42b01387 100644 --- a/password_reset/tests/settings.py +++ b/password_reset/tests/settings.py @@ -16,9 +16,7 @@ 'password_reset.tests', ) -MIGRATION_MODULES = { - 'auth': 'django.contrib.auth.tests.migrations', -} +MIDDLEWARE = [] TEMPLATES = [{ 'BACKEND': 'django.template.backends.django.DjangoTemplates', diff --git a/setup.py b/setup.py index 2e02ba82..3b5d5420 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,7 @@ 'Framework :: Django :: 1.8', 'Framework :: Django :: 1.9', 'Framework :: Django :: 1.10', + 'Framework :: Django :: 1.11', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Natural Language :: English', diff --git a/tox.ini b/tox.ini index f64c61b1..a35a8fd7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,9 @@ [tox] envlist = - py27-django1{8,9,10}, + py27-django1{8,9,10,11}, py33-django18, - py34-django1{8,9,10}, - py35-django1{8,9,10}, + py34-django1{8,9,10,11}, + py35-django1{8,9,10,11}, docs, lint [testenv] @@ -17,6 +17,7 @@ deps = django18: Django>=1.8,<1.9 django19: Django>=1.9,<1.10 django110: Django>=1.10,<1.11 + django111: Django>=1.11,<2.0 [testenv:docs] basepython = python3.5 From c3743dc10f38b2b141eb6e84c66bc6d4b068b101 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 25 May 2017 10:29:03 -0400 Subject: [PATCH 7/9] Fix E305 flake8 warnings --- password_reset/tests/views.py | 6 ++++++ password_reset/views.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/password_reset/tests/views.py b/password_reset/tests/views.py index 9927bdc8..f9e2da4e 100644 --- a/password_reset/tests/views.py +++ b/password_reset/tests/views.py @@ -3,14 +3,20 @@ class EmailRecover(views.Recover): search_fields = ['email'] + + email_recover = EmailRecover.as_view() class UsernameRecover(views.Recover): search_fields = ['username'] + + username_recover = UsernameRecover.as_view() class InsensitiveRecover(views.Recover): case_sensitive = False + + insensitive_recover = InsensitiveRecover.as_view() diff --git a/password_reset/views.py b/password_reset/views.py index dc7642c5..6f172a40 100644 --- a/password_reset/views.py +++ b/password_reset/views.py @@ -47,6 +47,8 @@ def get_context_data(self, **kwargs): except signing.BadSignature: raise Http404 return ctx + + recover_done = RecoverDone.as_view() @@ -106,6 +108,8 @@ def form_valid(self, form): email = self.user.email self.mail_signature = signing.dumps(email, salt=self.url_salt) return super(Recover, self).form_valid(form) + + recover = Recover.as_view() @@ -164,6 +168,8 @@ def form_valid(self, form): request=self.request ) return redirect(self.get_success_url()) + + reset = Reset.as_view() From 3adadc34ad07381fbab9e1387913f2e2cf8a878a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Reni=C3=A9?= Date: Tue, 30 May 2017 10:15:13 +0200 Subject: [PATCH 8/9] Bump version to 1.0 --- LICENSE | 2 +- docs/conf.py | 4 ++-- docs/index.rst | 2 +- password_reset/__init__.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LICENSE b/LICENSE index 7e364be7..b1f7d628 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2012, Bruno Renié and contributors. +Copyright (c) Bruno Renié and contributors. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/docs/conf.py b/docs/conf.py index c4d03971..3bbc5a1c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -50,9 +50,9 @@ # built documents. # # The short X.Y version. -version = '0.9' +version = '1.0' # The full version, including alpha/beta/rc tags. -release = '0.9' +release = '1.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/index.rst b/docs/index.rst index 25bcd234..ffa70c0e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -28,7 +28,7 @@ Contents: Changelog --------- -* 1.0 (TBA): +* 1.0 (2017-05-30): * Drop support for Django < 1.8 and confirm support for Django 1.10 and 1.11. diff --git a/password_reset/__init__.py b/password_reset/__init__.py index e46aee1f..7e49527e 100644 --- a/password_reset/__init__.py +++ b/password_reset/__init__.py @@ -1 +1 @@ -__version__ = '0.9' +__version__ = '1.0' From b2d46c1a1a7c0fd0b162323c1bfac627cd03a2e9 Mon Sep 17 00:00:00 2001 From: chani hoffman Date: Thu, 23 Nov 2017 13:44:33 +0200 Subject: [PATCH 9/9] translations for hebrew --- .../locale/heb/LC_MESSAGES/django.mo | Bin 0 -> 3182 bytes .../locale/heb/LC_MESSAGES/django.po | 151 ++++++++++++++++++ 2 files changed, 151 insertions(+) create mode 100644 password_reset/locale/heb/LC_MESSAGES/django.mo create mode 100644 password_reset/locale/heb/LC_MESSAGES/django.po diff --git a/password_reset/locale/heb/LC_MESSAGES/django.mo b/password_reset/locale/heb/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..27e9353fe2d5ff668234d6acd86fa83caf0be36d GIT binary patch literal 3182 zcmb7FOK%%h6ds^F>Xuh|ONE|R1Y$MgJPM+69yFwG8v&NFp9uo;4a_|;Df;LfDZs~0!M(~1K$H~$Kp<4 z8Tc%)27Che3GhkaDsT_*n`r-M;8U3Y0c5+sfoFj`wuN@}2$z6QWBps;Bfy`4?C%%g zJHS7IuLIu%xn5umcnY`%{1CbP1N<2C#>0m3C~zB`Fwb4U?Z7?25nvj)3akK`*A8s% z=Y8Nyz~jK@fMOR3Ngl%kY5{l7gSqg4Y(XBZ3G4nmp5%B46S#;6%4L8;JeW&s zaGhCeNEQr8Wcp^naAFRcf$je!w z8h5UcbRkPYLJK#ox7g>B7?a_7sx)FrjVWZ7)YzDkN;SH|gj(4mGAj_)N25fumSYz( zbQ)6SEf;BWvI7>Cl_(DG>*#DTeZQuhwB9$Q#0NE@TlJK#80fZ!GHtQAUeH}=R$iR5 zwU;rb(G*@?#%whe>;mssEH7Wq7$;q8#({~Xq7BvA1s0>`h+jx53cG~)nkLV+tO(Gc zsuG@X3$|NgFEc?;ut^zh9FZ0UwBc<^w8@<@VjWs-l2nvt8dQ{yBkMsFZWIbI^-3Lbze6HcJCdxEqySDx=V{&Ycq6HCe(&y1NX7(KD>4Bj+DQ0bU9@(AF4Nsb5{; z6w1uGdC4u5rGqoJmzr>D%5uyjQdM-8+-fk@gMIxJz7BS}w0Dqt)BP#KpYxafi+Gm( z74k3p>;8(rL<8M3Y6uJW_<+Lh8tj+jFKLGSCXR2w+q%C<{=B~ir+D>m5TNB6=Q!jw ztY6_1S1`GPGfkuYvzjDk;QR^>tafd_CAjgm3%|yRFD>FPapc%PVZH!IO#@q;@q*tZ zIAu1MnC=b#I;NNX3;rr098+HOHwXs!X}Q@5x36J)(Lc`#Z1`7UeUVc}7D?K?`?=o? zglU~e$PJvGV`>+m!ZK^q1cf=CU-dVPI224{#!ZO1;xDiM0N+w+`V zB5Lev9p{(8E2v9sz`|~|jzEd;`dy7KV+W06;AeeH?@j+R2!5A(%(2ug-*wQwib5=N z3FiDSXtRgHtUl=&DcPa=F zUYIRIp#F;y , 2017. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-23 22:24-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Michael Mash \n" +"Language-Team: ES \n" +"Language: ES\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: forms.py:26 +msgid "Username" +msgstr "שם משתמש" + +#: forms.py:27 +msgid "Email" +msgstr "אימייל" + +#: forms.py:28 +msgid "Username or Email" +msgstr "שם משתמש או אימייל" + +#: forms.py:48 forms.py:58 forms.py:70 +msgid "Sorry, this user doesn't exist." +msgstr "שם משתמש אינו קיים" + +#: forms.py:72 +msgid "Unable to find user." +msgstr "לא נמצא שם משתמש" + +#: forms.py:78 +msgid "New password" +msgstr "סיסמה חדשה" + +#: forms.py:82 +msgid "New password (confirm)" +msgstr "הקלד שנית לאימות הסיסמה" + +#: forms.py:94 +msgid "The two passwords didn't match." +msgstr "הסיסמאות אינן תואמות" + +#: templates/password_reset/recovery_done.html:3 +msgid "New password set" +msgstr "נקלטה סיסמה חדשה" + +#: templates/password_reset/recovery_done.html:6 +msgid "" +"Your password has successfully been reset. You can use it right now on the " +"login page." +msgstr "" +"הסיסמה שלך הוגדרה בהצלחה. אתם יכולים להשתמש בה כעת בדף הכניסה " + +#: templates/password_reset/recovery_email.txt:1 +#, python-format +msgid "Dear %(username)s," +msgstr "%(username)s," + +#: templates/password_reset/recovery_email.txt:3 +#, python-format +msgid "" +"You -- or someone pretending to be you -- has requested a password reset on " +"%(domain)s." +msgstr "" +"אתם או מישהו בשמכם ביקש איפוס סיסמה ב " +"%(domain)s." + +#: templates/password_reset/recovery_email.txt:5 +msgid "You can set your new password by following this link:" +msgstr "לחצו על הקישור לאיפוס סיסמה" + +#: templates/password_reset/recovery_email.txt:9 +msgid "" +"If you don't want to reset your password, simply ignore this email and it " +"will stay unchanged." +msgstr "" +"במידה ואין ברצונכם לשנות את סיסמתכם פשוט התעלמו מהאימייל הזה. " +"הסיסמה תשאר כפי שהיא כעת""" + +#: templates/password_reset/recovery_email_subject.txt:1 +#, python-format +msgid "Password recovery on %(domain)s" +msgstr "שיחזור סיסמה ל%(domain)s" + +#: templates/password_reset/recovery_form.html:5 +msgid "Password recovery" +msgstr "שיחזור סיסמה" + +#: templates/password_reset/recovery_form.html:11 +msgid "Recover my password" +msgstr "לשחזור סיסמה" + +#: templates/password_reset/reset.html:5 +#, python-format +msgid "" +"Sorry, this password reset link is invalid. You can still request a new one." +msgstr "" +"אנו מצטערים אך קישורית זו לאיפוס סיסמה אינה תקינה. אתה יכול לבקש קישור חדש." + +#: templates/password_reset/reset.html:7 +#, python-format +msgid "Hi, %(username)s. Please choose your new password." +msgstr "שלום, %(username)s. בחר סיסמה חדשה" + +#: templates/password_reset/reset.html:11 +msgid "Set new password" +msgstr "הגדר סיסמה חדשה" + +#: templates/password_reset/reset_sent.html:4 +msgid "Password recovery sent" +msgstr "שיחזור סיסמה נשלח" + +#: templates/password_reset/reset_sent.html:7 +#, python-format +msgid "" +"An email was sent to %(email)s %(ago)s ago. Use the link in " +"it to set a new password." +msgstr "" +"אימייל נשלח
ל %(email)s לפני %(ago)s . " +"השתמשו בקישור שנשלח לאיפוס הסיסמה" + +#we suggest to replace this origin messages: + + +#: templates/password_reset/recovery_email.txt:1 +#, python-format +msgid "Hi," +msgstr "שלום," + + + +#: templates/password_reset/recovery_email.txt:3 +#, python-format +msgid "" +"You has requested a password reset on " +"%(domain)s." +msgstr "" +"ביקשת איפוס סיסמה בדומיין " +"%(domain)s." +