Compare commits
No commits in common. "bb1dafc89c609e01a6f75ebb915b33c8cbbf1734" and "f8cae76f05ea27a7dd59b3a633b092f27a12fba3" have entirely different histories.
bb1dafc89c
...
f8cae76f05
3
Pipfile
3
Pipfile
@ -6,8 +6,6 @@ verify_ssl = true
|
|||||||
[dev-packages]
|
[dev-packages]
|
||||||
pylint = "*"
|
pylint = "*"
|
||||||
coverage = "*"
|
coverage = "*"
|
||||||
autopep8 = "*"
|
|
||||||
pipenv = "*"
|
|
||||||
|
|
||||||
[packages]
|
[packages]
|
||||||
django = "*"
|
django = "*"
|
||||||
@ -15,6 +13,7 @@ easy-thumbnails = "*"
|
|||||||
image = "*"
|
image = "*"
|
||||||
django-widget-tweaks = "*"
|
django-widget-tweaks = "*"
|
||||||
django-taggit = "*"
|
django-taggit = "*"
|
||||||
|
|
||||||
# Commented out to not explicitly specify Python 3 subversion.
|
# Commented out to not explicitly specify Python 3 subversion.
|
||||||
# [requires]
|
# [requires]
|
||||||
# python_version = "3.8"
|
# python_version = "3.8"
|
||||||
|
@ -12,11 +12,6 @@ from django.urls import reverse_lazy
|
|||||||
from lostplaces_app.models import Place
|
from lostplaces_app.models import Place
|
||||||
|
|
||||||
class IsAuthenticated(LoginRequiredMixin, View):
|
class IsAuthenticated(LoginRequiredMixin, View):
|
||||||
'''
|
|
||||||
A view mixin that checks wether a user is loged in or not.
|
|
||||||
If the user is not logged in, he gets redirected to
|
|
||||||
the login page.
|
|
||||||
'''
|
|
||||||
redirect_field_name = 'redirect_to'
|
redirect_field_name = 'redirect_to'
|
||||||
permission_denied_message = 'Please login to proceed'
|
permission_denied_message = 'Please login to proceed'
|
||||||
|
|
||||||
@ -25,12 +20,6 @@ class IsAuthenticated(LoginRequiredMixin, View):
|
|||||||
return super().handle_no_permission()
|
return super().handle_no_permission()
|
||||||
|
|
||||||
class IsPlaceSubmitter(UserPassesTestMixin, View):
|
class IsPlaceSubmitter(UserPassesTestMixin, View):
|
||||||
'''
|
|
||||||
A view mixin that checks wethe a user is the submitter
|
|
||||||
of a place Throws 403 if the user is not. The subclass
|
|
||||||
has to provide a get_place method, wich returns the
|
|
||||||
place to check.
|
|
||||||
'''
|
|
||||||
place_submitter_error_message = None
|
place_submitter_error_message = None
|
||||||
|
|
||||||
def get_place(self):
|
def get_place(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user