fix syntax error in user lookups issue #37

This commit is contained in:
Morgan McMillian 2019-01-08 22:03:17 -08:00
parent c9be0256e4
commit a95c3df51a

View file

@ -63,7 +63,7 @@ def save_cb(room, event):
def drop_cb(room, event): def drop_cb(room, event):
try: try:
user = Users.query.filter(Users.matrix_id=event['sender']).one_or_none() user = Users.query.filter(Users.matrix_id == event['sender']).one_or_none()
if user is not None: if user is not None:
db_session.delete(user) db_session.delete(user)
db_session.commit() db_session.commit()
@ -79,7 +79,7 @@ def drop_cb(room, event):
def status_cb(room, event): def status_cb(room, event):
try: try:
user = Users.query.filter(Users.matrix_id=event['sender']).one_or_none() user = Users.query.filter(Users.matrix_id == event['sender']).one_or_none()
if user is None: if user is None:
reply = "You are currently not authorized on pnut.io" reply = "You are currently not authorized on pnut.io"
else: else:
@ -99,7 +99,7 @@ def status_cb(room, event):
if __name__ == "__main__": if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG) logging.basicConfig(level=logging.INFO)
with open("config.yaml", "rb") as config_file: with open("config.yaml", "rb") as config_file:
config = yaml.load(config_file) config = yaml.load(config_file)