diff options
author | sriyasainath | 2017-06-09 23:39:20 +0530 |
---|---|---|
committer | sriyasainath | 2017-06-10 00:00:37 +0530 |
commit | 362fec85e066bc7d5ab5d48a0c18f88b96197f74 (patch) | |
tree | e0a35f9d2f13c2ad5cc4a871f91488f644796408 | |
parent | b925ede28074167b21cef270ff3e8d2a0f0d0b97 (diff) | |
download | SBHS-2018-Rpi-362fec85e066bc7d5ab5d48a0c18f88b96197f74.tar.gz SBHS-2018-Rpi-362fec85e066bc7d5ab5d48a0c18f88b96197f74.tar.bz2 SBHS-2018-Rpi-362fec85e066bc7d5ab5d48a0c18f88b96197f74.zip |
Add check to allow the admin to access the temp offline boards but prohibit users
-rw-r--r-- | experiment/views.py | 4 |
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() |