Skip to content

Commit

Permalink
Fix roster user bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dwang159 authored and houqp committed Jun 1, 2017
1 parent 0cd1fc6 commit 6fb39e2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/oncall/api/v0/roster_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ def on_put(req, resp, team, roster, user):
connection = db.connect()
cursor = connection.cursor()

cursor.execute('UPDATE `roster_user` SET `in_rotation`=%s '
'WHERE `user_id` = (SELECT `id` FROM `user` WHERE `name`=%s)'
'AND `roster_id` = (SELECT `id` FROM `roster` WHERE `name`=%s)',
(in_rotation, user, roster))
cursor.execute('''UPDATE `roster_user` SET `in_rotation`=%s
WHERE `user_id` = (SELECT `id` FROM `user` WHERE `name`=%s)
AND `roster_id` =
(SELECT `id` FROM `roster` WHERE `name`=%s
AND `team_id` = (SELECT `id` FROM `team` WHERE `name` = %s))''',
(in_rotation, user, roster, team))
create_audit({'user': user, 'roster': roster, 'request_body': data},
team,
ROSTER_USER_EDITED,
Expand Down

0 comments on commit 6fb39e2

Please sign in to comment.