Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

Commit

Permalink
HOTFIX - fix bug where setting timezone before setting a role wouldn'…
Browse files Browse the repository at this point in the history
…t work
  • Loading branch information
jgayfer committed Aug 19, 2017
1 parent 1a10bb7 commit 37a8bfb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.5.2] - 2017-08-18
### Fixed
- Bug where setting your timezone before assigning a role wouldn't work

## [0.5.1] - 2017-08-12
### Fixed
- Countdown command was displaying incorrect values
Expand Down
2 changes: 1 addition & 1 deletion cogs/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import discord
import pytz

VERSION = "0.5.1"
VERSION = "0.5.2"
BLUE = discord.Colour(3381759)
SPAM_DELAY = 4.5
REACTION_DELAY = 1
Expand Down
9 changes: 4 additions & 5 deletions db/dbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@ def update_role(self, username, role, server_id):

def update_timezone(self, username, timezone, server_id):
sql = """
UPDATE roster
SET timezone = %s
WHERE username = %s
AND server_id = %s;
INSERT INTO roster (username, timezone, server_id)
VALUES (%s, %s, %s)
ON DUPLICATE KEY UPDATE timezone = %s;
"""
self.cur.execute(sql, (timezone, username, server_id))
self.cur.execute(sql, (username, timezone, server_id, timezone))
self.conn.commit()

def create_event(self, title, start_time, timezone, server_id, description, max_members):
Expand Down

0 comments on commit 37a8bfb

Please sign in to comment.