Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

Commit

Permalink
Merge 2836384 into d0b39a0
Browse files Browse the repository at this point in the history
  • Loading branch information
smlz committed Dec 15, 2015
2 parents d0b39a0 + 2836384 commit aec732d
Show file tree
Hide file tree
Showing 65 changed files with 549 additions and 419 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ demo/media/admin

# Temp vim files
*.swp

# Backup files
*~
13 changes: 10 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
language: python
python: 2.7
env:
- TOX_ENV=py26-django14
- TOX_ENV=py26-django15
- TOX_ENV=py26-django16

- TOX_ENV=py27-django14
- TOX_ENV=py27-django15
- TOX_ENV=py27-django16
- TOX_ENV=py27-django17
- TOX_ENV=py27-django18
- TOX_ENV=py27-django19

- TOX_ENV=py32-django15
- TOX_ENV=py32-django16
- TOX_ENV=py32-django17
- TOX_ENV=py32-django18

- TOX_ENV=py33-django15
- TOX_ENV=py33-django16
- TOX_ENV=py33-django17
- TOX_ENV=py33-django18

- TOX_ENV=py34-django17
- TOX_ENV=py34-django18
- TOX_ENV=py34-django19

- TOX_ENV=py35-django18
- TOX_ENV=py35-django19

- TOX_ENV=coverage
install:
- pip install tox==1.8.1
- pip install tox==2.2.1
script:
- tox -e $TOX_ENV
1 change: 0 additions & 1 deletion demo/demo/templates/base.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% load i18n static %}
{% load url from future %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
Expand Down
1 change: 0 additions & 1 deletion demo/demo/templates/static/promo.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% extends "base.html" %}
{% load url from future %}
{% block content %}
<div id="intro">
<h2 class="intro"><span>django-userena</span><br/>Accounts made beautifully simple</h2>
Expand Down
1 change: 0 additions & 1 deletion demo/demo/templates/umessages/message_detail.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends 'umessages/base_message.html' %}
{% load i18n %}
{% load url from future %}

{% block content_title %}<h2 class="content-title">Conversation with {{ recipient }}</h2>{% endblock %}

Expand Down
1 change: 0 additions & 1 deletion demo/demo/templates/umessages/message_list.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends 'umessages/base_message.html' %}
{% load i18n umessages_tags %}
{% load url from future %}

{% block content_title %}{% get_unread_message_count_for user as unread_message_count %}
<h2 class="content-title">Messages ({{ unread_message_count }} )</h2>{% endblock %}
Expand Down
1 change: 0 additions & 1 deletion demo/demo/templates/userena/email_form.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends 'userena/base_userena.html' %}
{% load i18n %}
{% load url from future %}

{% block content_title %}<h2 class="content-title">Account &raquo; {{ account.user.username }}</h2>{% endblock %}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load i18n %}{% autoescape off %}{% load url from future %}
{% load i18n %}{% autoescape off %}
<html>
<body>
<h1>Test message</h1>
Expand All @@ -15,4 +15,4 @@ <h1>Test message</h1>
</p>
</body>
</html>
{% endautoescape %}
{% endautoescape %}
1 change: 0 additions & 1 deletion demo/demo/templates/userena/password_form.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends 'userena/base_userena.html' %}
{% load i18n %}
{% load url from future %}

{% block title %}{% trans "Change password" %}{% endblock %}

Expand Down
1 change: 0 additions & 1 deletion demo/demo/templates/userena/profile_detail.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends 'userena/base_userena.html' %}
{% load i18n %}
{% load url from future %}

{% block title %}{{ profile.user.username }}'s {% trans "profile" %}.{% endblock %}
{% block content_title %}<h2 class="content-title">{{ profile.user.username }} {% if profile.user.get_full_name %}({{ profile.user.get_full_name }}){% endif %}</h2>{% endblock %}
Expand Down
1 change: 0 additions & 1 deletion demo/demo/templates/userena/profile_form.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends 'userena/base_userena.html' %}
{% load i18n %}
{% load url from future %}

{% block title %}{% trans "Account setup" %}{% endblock %}

Expand Down
1 change: 0 additions & 1 deletion demo/demo/templates/userena/profile_list.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends 'userena/base_userena.html' %}
{% load i18n %}
{% load url from future %}

{% block content_title %}<h2 class="content-title">{% trans 'Profiles' %}</h2>{% endblock %}

Expand Down
14 changes: 7 additions & 7 deletions demo/demo/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/', include(admin.site.urls)),
urlpatterns = [
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', include(admin.site.urls)),

# Demo Override the signup form with our own, which includes a
# first and last name.
# (r'^accounts/signup/$',
# 'userena.views.signup',
# {'signup_form': SignupFormExtra}),

(r'^accounts/', include('userena.urls')),
(r'^messages/', include('userena.contrib.umessages.urls')),
url(r'^accounts/', include('userena.urls')),
url(r'^messages/', include('userena.contrib.umessages.urls')),
url(r'^$', 'profiles.views.promo', name='promo'),
(r'^i18n/', include('django.conf.urls.i18n')),
)
url(r'^i18n/', include('django.conf.urls.i18n')),
]

# Add media and static files
urlpatterns += staticfiles_urlpatterns()
Expand Down
2 changes: 1 addition & 1 deletion demo/superuser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
from wsgi import *
from userena.utils import get_user_model
from django.contrib.auth import get_user_model
try:
wunki = get_user_model().objects.get(username='wunki')
except get_user_model().DoesNotExist:
Expand Down
43 changes: 21 additions & 22 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,33 @@ downloadcache = {toxworkdir}/cache/

envlist =
; py26 support was dropped in django1.7
py26-django{14,15,16},
; py27 has the widest django support
py27-django{14,15,16,17},
py26-django{15,16},
; py27 still has the widest django support
py27-django{15,16,17,18,19},
; py32, py33 support was officially introduced in django1.5
py32-django{15,16,17},
py33-django{15,16,17},
; py32, py33 support was dropped in django1.9
py32-django{15,16,17,18},
py33-django{15,16,17,18},
; py34 support was officially introduced in django1.7
py34-django{17}
py34-django{17,18,19}
; py35 support was officially introduced in django1.8
py35-django{18,19}

[testenv]
usedevelop = True
deps =
south
django14: django==1.4.16
django15: django==1.5.11
django16: django==1.6.8
django17: django==1.7.1
coverage: django==1.7.1
coverage: coverage==3.7.1
coverage: coveralls
django{15,16}: south
django15: django==1.5.12
django16: django==1.6.11
django17: django==1.7.11
django18: django==1.8.7
django19: django==1.9
coverage: django==1.9
coverage: coverage==4.0.3
coverage: coveralls==1.1

basepython =
py35: python3.5
py34: python3.4
py33: python3.3
py32: python3.2
Expand All @@ -33,15 +38,9 @@ basepython =

commands={envpython} userena/runtests/runtests.py userena umessages

[testenv:py27-django14]
install_command = pip install --no-binary=Django {opts} {packages}

[testenv:py26-django14]
install_command = pip install --no-binary=Django {opts} {packages}

[testenv:coverage]
basepython = python2.7

passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
commands=
coverage run --source userena userena/runtests/runtests.py userena umessages
coverage run --source=userena userena/runtests/runtests.py userena umessages
coveralls
3 changes: 2 additions & 1 deletion userena/admin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext as _
from guardian.admin import GuardedModelAdmin

from userena.models import UserenaSignup
from userena import settings as userena_settings
from userena.utils import get_profile_model, get_user_model
from userena.utils import get_profile_model

class UserenaSignupInline(admin.StackedInline):
model = UserenaSignup
Expand Down
2 changes: 1 addition & 1 deletion userena/backends.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import django.core.validators
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend

from userena.utils import get_user_model

class UserenaAuthenticationBackend(ModelBackend):
"""
Expand Down
21 changes: 11 additions & 10 deletions userena/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@
# Django<1.6.0 uses uidb36, we construct urlpattern depending on this
password_reset_uid_kwarg = 'uidb36'

if django.VERSION < (1, 5, 0):
from django.utils.encoding import smart_unicode as smart_text
else:
from django.utils.encoding import smart_text


# SiteProfileNotAvailable compatibility
if django.VERSION < (1, 7, 0): # pragma: no cover
Expand All @@ -48,14 +43,20 @@
class SiteProfileNotAvailable(Exception):
pass

# old fallback to django hashcompat
try:
from hashlib import sha1 as sha_constructor, md5 as md5_constructor
except ImportError: # pragma: no cover
from django.utils.hashcompat import sha_constructor, md5_constructor

if django.VERSION < (1, 7, 0):
from django.db.models import get_model
else:
from django.apps import apps
get_model = apps.get_model


# optparse/argparse compatibility helper for simple cases (long options only)
# for an example useage see userena/management/commands/check_permissions.py
if django.VERSION < (1, 8):
from optparse import make_option
def make_options(options):
return list(make_option(opt, **attrs) for opt, attrs in options)
else:
def make_options(options):
return ()
2 changes: 1 addition & 1 deletion userena/contrib/umessages/fields.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django import forms
from django.contrib.auth import get_user_model
from django.forms import widgets
from django.utils.translation import ugettext_lazy as _

from userena.utils import get_user_model

class CommaSeparatedUserInput(widgets.Input):
input_type = 'text'
Expand Down
Loading

0 comments on commit aec732d

Please sign in to comment.