Commit fe8126ee authored by Michal Čihař's avatar Michal Čihař

Support django-registration 0.8 (issue #45)

parent 9f0887e4
...@@ -26,6 +26,7 @@ Relased on ? 2012. ...@@ -26,6 +26,7 @@ Relased on ? 2012.
* Support for locking translation by translator. * Support for locking translation by translator.
* Optionally maintain Language-Team header in po file. * Optionally maintain Language-Team header in po file.
* Include some statistics in about page. * Include some statistics in about page.
* Supports (and requires) django-registration 0.8.
weblate 1.1 weblate 1.1
----------- -----------
......
...@@ -14,7 +14,7 @@ Translate-toolkit ...@@ -14,7 +14,7 @@ Translate-toolkit
http://translate.sourceforge.net/wiki/toolkit/index http://translate.sourceforge.net/wiki/toolkit/index
GitPython (>= 0.3) GitPython (>= 0.3)
https://github.com/gitpython-developers/GitPython https://github.com/gitpython-developers/GitPython
Django-registration (<= 0.7, 0.8 won't work) Django-registration (>= 0.8)
https://bitbucket.org/ubernostrum/django-registration/ https://bitbucket.org/ubernostrum/django-registration/
Whoosh Whoosh
http://bitbucket.org/mchaput/whoosh/ http://bitbucket.org/mchaput/whoosh/
......
...@@ -13,7 +13,7 @@ Url: http://weblate.org/ ...@@ -13,7 +13,7 @@ Url: http://weblate.org/
Requires: apache2-mod_wsgi Requires: apache2-mod_wsgi
Requires: cron Requires: cron
Requires: python-django >= 1.3 Requires: python-django >= 1.3
Requires: python-django-registration Requires: python-django-registration >= 0.8
Requires: translate-toolkit Requires: translate-toolkit
Requires: python-GitPython >= 0.3 Requires: python-GitPython >= 0.3
Requires: python-whoosh Requires: python-whoosh
......
...@@ -4,33 +4,11 @@ ...@@ -4,33 +4,11 @@
{% block content %} {% block content %}
{% if account %} <h2>{% trans "Your account could not be activated" %}</h2>
<p>
{% blocktrans with account.username as username %}Thank you. Your
account is now activated. Your username is
<b>{{ username }}</b>.{% endblocktrans %}
</p>
<p>
{% url 'weblate.accounts.views.profile' as profile_url %}
{% blocktrans %}You might want to <a href="{{ profile_url }}">adjust your profile</a> now.{% endblocktrans %}
</p>
{% else %}
<p> <p>
{% blocktrans count expiration_days as days %}This may be because it is already active or because you waited over {{ days }} day to activate it.{% plural %} This may be because it is already active or because you waited over {{ days }} days to activate it.{% endblocktrans %}
{% url 'registration.views.register' as reg_url %} {% url 'registration.views.register' as reg_url %}
{% blocktrans count expiration_days as days %} {% blocktrans %}If this is not the case, please <a href="/contact/">contact</a> the website administrator. Otherwise, you may <a href="{{ reg_url }}">register again</a>.{% endblocktrans %}
Your account could not be activated.
This may be because it is already active or because you waited over
{{ days }} day to activate it.
If this is not the case, please contact the website administrator.
Otherwise, you may <a href="{{ reg_url }}">register again</a>.
{% plural %}
Your account could not be activated.
This may be because it is already active or because you waited over
{{ days }} days to activate it.
If this is not the case, please contact the website administrator.
Otherwise, you may <a href="{{ reg_url }}">register again</a>.
{% endblocktrans %}
</p> </p>
{% endif %}
{% endblock %} {% endblock %}
{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
{% block content %}
<p>
{% blocktrans %}Thank you. Your account is now activated.{% endblocktrans %}
</p>
<p>
{% url 'weblate.accounts.views.profile' as profile_url %}
{% blocktrans %}You might want to <a href="{{ profile_url }}">adjust your profile</a> now.{% endblocktrans %}
</p>
{% endblock %}
{% extends "base.html" %}
{% load i18n %}
{% block content %}
<p>{% blocktrans %}Sorry, but registrations on this site are disabled. You can <a href="/contact/">contact us</a> for more details.{% endblocktrans %}</p>
{% endblock %}
...@@ -98,8 +98,10 @@ urlpatterns = patterns('', ...@@ -98,8 +98,10 @@ urlpatterns = patterns('',
# Auth # Auth
url(r'^accounts/register/$', register, { url(r'^accounts/register/$', register, {
'backend': 'registration.backends.default.DefaultBackend',
'form_class': RegistrationForm, 'form_class': RegistrationForm,
'extra_context': {'title': _('User registration')}}, 'extra_context': {'title': _('User registration')}
},
name='weblate_register'), name='weblate_register'),
url(r'^accounts/register/complete/$', url(r'^accounts/register/complete/$',
direct_to_template, direct_to_template,
...@@ -108,9 +110,29 @@ urlpatterns = patterns('', ...@@ -108,9 +110,29 @@ urlpatterns = patterns('',
'extra_context': {'title': _('User registration')}, 'extra_context': {'title': _('User registration')},
}, },
name='registration_complete'), name='registration_complete'),
url(r'^accounts/register/closed/$',
direct_to_template,
{
'template': 'registration/registration_closed.html',
'extra_context': {'title': _('User registration')},
},
name='registration_disallowed'),
url(r'^accounts/activate/complete/$',
direct_to_template,
{
'template': 'registration/activation_complete.html',
'extra_context': {'title': _('User registration')},
},
name='registration_activation_complete'),
url(r'^accounts/activate/(?P<activation_key>\w+)/$', url(r'^accounts/activate/(?P<activation_key>\w+)/$',
activate, activate,
{'extra_context': {'title': _('Account activation')}}, {
'backend': 'registration.backends.default.DefaultBackend',
'extra_context': {
'title': _('Account activation'),
'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS,
}
},
name='registration_activate'), name='registration_activate'),
url(r'^accounts/login/$', url(r'^accounts/login/$',
auth_views.login, auth_views.login,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment