Skip to content

Commit 5f69581

Browse files
Removing trailing whitespace.
1 parent 2b86bd5 commit 5f69581

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/create_custom_permission.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ A custom permission is a simple method of the permission class::
2525
class FlatpagePermission(permissions.BasePermission):
2626
label = 'flatpage_permission'
2727
checks = ('my_custom_check',)
28-
28+
2929
def my_custom_check(self, flatpage):
3030
if(flatpage.url == '/about/'):
3131
return True
3232
return False
33-
33+
3434
authority.register(Flatpage, FlatpagePermission)
3535

3636
Note that we first added the name of your custom permission to the ``checks``
@@ -47,7 +47,7 @@ permission is True or False::
4747
return True
4848
return False
4949

50-
.. warning:: Although it's possible to return other values than ``True``, for
50+
.. warning:: Although it's possible to return other values than ``True``, for
5151
example an object which also evluates to True, we highly advise to only
5252
return booleans.
5353

@@ -86,7 +86,7 @@ In your python code
8686
::
8787

8888
from myapp.permissions import FlatPagePermission
89-
def my_view(request):
89+
def my_view(request):
9090
check = FlatPagePermission(request.user)
9191
flatpage_object = Flatpage.objects.get(url='/homepage/')
9292
if check.my_custom_check(flatpage=flatpage_object):
@@ -103,9 +103,9 @@ Using the view decorator
103103
(Flatpage, 'url__iexact', 'url')) # The flatpage_object
104104
def my_view(request, url):
105105
# ...
106-
106+
107107
See :ref:`check-decorator` how the decorator works in detail.
108-
108+
109109
In your templates
110110
-----------------
111111
::

0 commit comments

Comments
 (0)