summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsriyasainath2017-06-09 23:39:20 +0530
committersriyasainath2017-06-10 00:00:37 +0530
commit332484deb0d5f98d581c5ecaf382ca3df56698d2 (patch)
tree2739610171a5e423c9001d2e53cf55334a1f8988
parente4842a334cc388043ab2ca83354170b35d114c74 (diff)
downloadSBHS-2018-Rpi-332484deb0d5f98d581c5ecaf382ca3df56698d2.tar.gz
SBHS-2018-Rpi-332484deb0d5f98d581c5ecaf382ca3df56698d2.tar.bz2
SBHS-2018-Rpi-332484deb0d5f98d581c5ecaf382ca3df56698d2.zip
Add check to allow the admin to access the temp offline boards but prohibit users
-rw-r--r--experiment/views.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/experiment/views.py b/experiment/views.py
index 3ea5a8d..9b493f3 100644
--- a/experiment/views.py
+++ b/experiment/views.py
@@ -22,7 +22,9 @@ def initiation(req):
user1 = Account.objects.select_related().filter(id=user.id)
user1 = user1[0]
user_board = user1.board
- if user_board.online:
+
+ #allows admin to access the temporary offline devices but prohibits the users to do so
+ if user_board.online and (not user_board.temp_offline or user1.is_admin):
slots = Slot.slots_now()
slot_ids = [s.id for s in slots]
now = datetime.datetime.now()