Commits

Tim Savage committed a057f24

Added encoding in header and cleaned up to comply with pep8

Comments (0)

Files changed (3)

django_extras/contrib/auth/decorators.py

+# -*- encoding:utf8 -*-
 from django.contrib.auth.decorators import *
 from django.core.exceptions import PermissionDenied
 
 
 def superuser_required(function=None, login_url=None, raise_exception=False):
     """
-    Decorator for views that checks that the user is a superuser, redirecting to
-    the log-in page if necessary.
+    Decorator for views that checks that the user is a superuser, redirecting
+    to the log-in page if necessary.
     """
     def check_permission(user):
         if user.is_superuser:
         return actual_decorator(function)
     return actual_decorator
 
-def staff_required(function=None, include_superusers=True, login_url=None, raise_exception=False):
+
+def staff_required(function=None, include_superusers=True, login_url=None,
+                   raise_exception=False):
     """
-    Decorator for views that checks that the user is a staff member, redirecting
-    to the log-in page if necessary.
+    Decorator for views that checks that the user is a staff member,
+    redirecting to the log-in page if necessary.
     """
     def check_permission(user):
         if user.is_staff or (include_superusers and user.is_superuser):

django_extras/contrib/auth/models.py

+# -*- encoding:utf8 -*-
 from django.contrib.auth.models import *
 from django.db import models
 

django_extras/contrib/auth/shortcuts.py

+# -*- encoding:utf8 -*-
 from django.shortcuts import get_object_or_404
 from django.core.exceptions import PermissionDenied