21
21
22
22
from getwvkeys import config , libraries
23
23
from getwvkeys .models .Shared import db
24
+ from getwvkeys .user import FlaskUser
24
25
from getwvkeys .utils import OPCode
25
26
26
27
@@ -57,7 +58,7 @@ def redis_message_handler(self, msg):
57
58
return
58
59
with self .app .app_context ():
59
60
try :
60
- libraries . User .disable_user (db , user_id )
61
+ FlaskUser .disable_user (db , user_id )
61
62
self .publish_response (reply_to )
62
63
except Exception as e :
63
64
self .publish_error (reply_to , "Error disablng user {}: {}" .format (user_id , e ))
@@ -68,7 +69,7 @@ def redis_message_handler(self, msg):
68
69
return
69
70
with self .app .app_context ():
70
71
try :
71
- libraries . User .disable_users (db , user_ids )
72
+ FlaskUser .disable_users (db , user_ids )
72
73
self .publish_response (
73
74
reply_to ,
74
75
)
@@ -81,7 +82,7 @@ def redis_message_handler(self, msg):
81
82
return
82
83
with self .app .app_context ():
83
84
try :
84
- libraries . User .enable_user (db , user_id )
85
+ FlaskUser .enable_user (db , user_id )
85
86
self .publish_response (
86
87
reply_to ,
87
88
)
@@ -92,7 +93,7 @@ def redis_message_handler(self, msg):
92
93
self .publish_response (reply_to , self .library .get_keycount ())
93
94
elif op == OPCode .USER_COUNT .value :
94
95
with self .app .app_context ():
95
- self .publish_response (reply_to , libraries . User .get_user_count ())
96
+ self .publish_response (reply_to , FlaskUser .get_user_count ())
96
97
elif op == OPCode .SEARCH .value :
97
98
query = d .get ("query" )
98
99
if not query :
@@ -114,7 +115,7 @@ def redis_message_handler(self, msg):
114
115
return
115
116
with self .app .app_context ():
116
117
try :
117
- user = libraries . User .get (db , user_id )
118
+ user = FlaskUser .get (db , user_id )
118
119
if not user :
119
120
self .publish_error (reply_to , "User not found" )
120
121
return
@@ -133,7 +134,7 @@ def redis_message_handler(self, msg):
133
134
elif op == OPCode .RESET_API_KEY .value :
134
135
user_id = d .get ("user_id" )
135
136
with self .app .app_context ():
136
- user = libraries . User .get (db , user_id )
137
+ user = FlaskUser .get (db , user_id )
137
138
if not user :
138
139
self .publish_error (reply_to , "User not found" )
139
140
return
0 commit comments