Skip to content

Commit 012712e

Browse files
committed
bug fix for updating permissions
1 parent f31e700 commit 012712e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

getwvkeys/redis.py

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"""
1717

1818
import json
19+
import logging
1920

2021
import redis
2122

@@ -24,6 +25,8 @@
2425
from getwvkeys.user import FlaskUser
2526
from getwvkeys.utils import OPCode
2627

28+
logger = logging.getLogger("getwvkeys")
29+
2730

2831
class Redis:
2932
def __init__(self, app, library: libraries.Library) -> None:
@@ -127,6 +130,7 @@ def redis_message_handler(self, msg):
127130
reply_to,
128131
)
129132
except Exception as e:
133+
logger.exception("Error updating permissions for {}: {}".format(user_id, e))
130134
self.publish_error(reply_to, "Error updating permissions for {}: {}".format(user_id, e))
131135
elif op == OPCode.QUARANTINE.value:
132136
# TODO: Implement

getwvkeys/user.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def update_flags(self, flags: Union[int, Bitfield], action: FlagAction):
8181
raise BadRequest("Unknown flag action")
8282

8383
self.db.session.commit()
84-
return User(self.db, self.user_model)
84+
return FlaskUser(self.db, self.user_model)
8585

8686
def reset_api_key(self):
8787
api_key = secrets.token_hex(32)

0 commit comments

Comments
 (0)