summaryrefslogtreecommitdiff
path: root/sbhs_server/tables/models.py
diff options
context:
space:
mode:
authordk-152017-05-18 18:37:13 +0530
committerdk-152017-05-18 18:37:13 +0530
commitca8e51f4399e41957d4acae4810c28b255607e6a (patch)
tree7e801e29ddfecf1353f67b8a6e6d9c4c8349bf0e /sbhs_server/tables/models.py
parentb469782556fa5c9d5e84713dd613b94c1aad1e7b (diff)
downloadSBHS-2018-Rpi-ca8e51f4399e41957d4acae4810c28b255607e6a.tar.gz
SBHS-2018-Rpi-ca8e51f4399e41957d4acae4810c28b255607e6a.tar.bz2
SBHS-2018-Rpi-ca8e51f4399e41957d4acae4810c28b255607e6a.zip
Fix MID bug in slot booking
Diffstat (limited to 'sbhs_server/tables/models.py')
-rw-r--r--sbhs_server/tables/models.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbhs_server/tables/models.py b/sbhs_server/tables/models.py
index 5be67aa..2b9e1e6 100644
--- a/sbhs_server/tables/models.py
+++ b/sbhs_server/tables/models.py
@@ -35,12 +35,12 @@ class Board(TrashableMixin):
board_num = random.randrange(online_boards_count)
return settings.online_mids[board_num]
else:
- last_MID = Account.objects.select_related().order_by("-id")[0].board.mid;
+ last_allocated_MID = Account.objects.select_related().order_by("-id")[0].board.mid;
online_boards = sorted(settings.online_mids)
for o in online_boards:
- if o > last_MID:
- return o
- return online_boards[0]
+ if o > last_allocated_MID:
+ return Board.objects.get(mid=o).id
+ return Board.objects.get(mid=online_boards[0]).id
def image_link(self):
return settings.WEBCAM_STATIC_DIR + "image" + str(self.mid) + ".jpeg"