mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-11 00:33:17 +00:00
PEP-8
This commit is contained in:
parent
b7e82e1a5a
commit
6749f688b6
4 changed files with 13 additions and 12 deletions
|
|
@ -38,7 +38,7 @@ class UserCreationForm(BaseUserCreationForm):
|
|||
username = self.cleaned_data["username"]
|
||||
try:
|
||||
# When called from BaseUserCreationForm, the method fails if using a AUTH_MODEL_MODEL,
|
||||
# This is because the following line tries to perform a lookup on
|
||||
# This is because the following line tries to perform a lookup on
|
||||
# the default "auth_user" table.
|
||||
User._default_manager.get(username=username)
|
||||
except User.DoesNotExist:
|
||||
|
|
|
|||
|
|
@ -9,19 +9,19 @@ class UserProfile(models.Model):
|
|||
user = models.OneToOneField(settings.AUTH_USER_MODEL)
|
||||
|
||||
submitted_notifications = models.BooleanField(
|
||||
default=True,
|
||||
help_text=_("Receive notification when a page is submitted for moderation")
|
||||
)
|
||||
default=True,
|
||||
help_text=_("Receive notification when a page is submitted for moderation")
|
||||
)
|
||||
|
||||
approved_notifications = models.BooleanField(
|
||||
default=True,
|
||||
help_text=_("Receive notification when your page edit is approved")
|
||||
)
|
||||
default=True,
|
||||
help_text=_("Receive notification when your page edit is approved")
|
||||
)
|
||||
|
||||
rejected_notifications = models.BooleanField(
|
||||
default=True,
|
||||
help_text=_("Receive notification when your page edit is rejected")
|
||||
)
|
||||
default=True,
|
||||
help_text=_("Receive notification when your page edit is rejected")
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def get_for_user(cls, user):
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ from django.contrib.auth.models import Group
|
|||
from django.contrib.auth.decorators import permission_required
|
||||
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
||||
from django.contrib import messages
|
||||
from django.db.models import Q
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.views.decorators.vary import vary_on_headers
|
||||
|
||||
|
|
@ -47,7 +46,7 @@ def index(request):
|
|||
|
||||
if ordering in ['name', 'username']:
|
||||
if ordering != 'name':
|
||||
users = users.order_by(ordering)
|
||||
groups = groups.order_by(ordering)
|
||||
else:
|
||||
ordering = 'name'
|
||||
|
||||
|
|
@ -76,6 +75,7 @@ def index(request):
|
|||
'query_string': q,
|
||||
})
|
||||
|
||||
|
||||
@permission_required(change_user_perm)
|
||||
def create(request):
|
||||
if request.POST:
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ def index(request):
|
|||
'query_string': q,
|
||||
})
|
||||
|
||||
|
||||
@permission_required(change_user_perm)
|
||||
def create(request):
|
||||
if request.POST:
|
||||
|
|
|
|||
Loading…
Reference in a new issue