From 4ff620e51a7b06c094b4f632faa7f57481b4a0d8 Mon Sep 17 00:00:00 2001 From: Doug Le Tough Date: Tue, 6 Mar 2018 02:05:20 +0100 Subject: [PATCH] "BUGFIX: No double staff update" --- participate.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/participate.py b/participate.py index e0b87e1..001be88 100755 --- a/participate.py +++ b/participate.py @@ -509,18 +509,18 @@ def save_staff_slot(turn_id, slot_id, user_id): slot = Tetawebapp_staffs(user_id=user_id, turn_id=turn_id, slot_num=slot_id) - try: - db.session.add(slot) - commit = db.session.commit() - except Exception as e: - db.session.rollback() - print "[+] Error at save_staff_slot:" - print "------------------------------" - print "%s" % e.message - print "------------------------------" - return False - if commit != None: - return False + try: + db.session.add(slot) + commit = db.session.commit() + except Exception as e: + db.session.rollback() + print "[+] Error at save_staff_slot:" + print "------------------------------" + print "%s" % e.message + print "------------------------------" + return False + if commit != None: + return False return True def get_roles():