diff options
author | maxbr <maxbr@mi.fu-berlin.de> | 2016-08-19 17:10:31 +0200 |
---|---|---|
committer | maxbr <maxbr@mi.fu-berlin.de> | 2016-08-19 17:10:31 +0200 |
commit | 3b5ef3b0a88247eeafeee878de528aad71f9fd4b (patch) | |
tree | 8f08dcacdfd5b313f04a46406d0282cdde3670e5 /tools/pharos-dashboard/dashboard/views/registration.py | |
parent | e556a63cc5f78598e890346889948765906a6411 (diff) |
Split the dashboard into different apps, add tests
JIRA: RELENG-12
Signed-off-by: maxbr <maxbr@mi.fu-berlin.de>
Diffstat (limited to 'tools/pharos-dashboard/dashboard/views/registration.py')
-rw-r--r-- | tools/pharos-dashboard/dashboard/views/registration.py | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/tools/pharos-dashboard/dashboard/views/registration.py b/tools/pharos-dashboard/dashboard/views/registration.py deleted file mode 100644 index 516fb298..00000000 --- a/tools/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 |