summaryrefslogtreecommitdiffstats
path: root/pharos-dashboard/dashboard/views/registration.py
diff options
context:
space:
mode:
authormaxbr <maxbr@mi.fu-berlin.de>2016-08-19 17:10:31 +0200
committermaxbr <maxbr@mi.fu-berlin.de>2016-08-19 17:10:31 +0200
commit79aec84973032e15ae9d36fcbd7d7d42af3283d1 (patch)
treec02fbd44cd53b0eed105bc648c743b10c62bfeb4 /pharos-dashboard/dashboard/views/registration.py
parent639cd5db77064c275253828780c17ae59551d95c (diff)
Split the dashboard into different apps, add tests
JIRA: RELENG-12 Signed-off-by: maxbr <maxbr@mi.fu-berlin.de>
Diffstat (limited to 'pharos-dashboard/dashboard/views/registration.py')
-rw-r--r--pharos-dashboard/dashboard/views/registration.py16
1 files changed, 0 insertions, 16 deletions
diff --git a/pharos-dashboard/dashboard/views/registration.py b/pharos-dashboard/dashboard/views/registration.py
deleted file mode 100644
index 516fb29..0000000
--- a/pharos-dashboard/dashboard/views/registration.py
+++ /dev/null
@@ -1,16 +0,0 @@
-from django.contrib.auth.mixins import UserPassesTestMixin
-
-
-class BookingUserTestMixin(UserPassesTestMixin):
- # Test if a user has permission to book this Pod
- def test_func(self):
- user = self.request.user
- # Check if User is troubleshooter / admin
- if user.has_perm(('dashboard.add_booking')):
- return True
- # Check if User owns this resource
- user_resources = user.userresource_set.get_queryset()
- for user_resource in user_resources:
- if user_resource.resource_id == self.resource.resource_id:
- return True
- return False