mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
More missed get_user_by_id API changes
This commit is contained in:
parent
da4ed08739
commit
92b20713d7
@ -180,7 +180,7 @@ class ApplicationServicesHandler(object):
|
|||||||
return
|
return
|
||||||
|
|
||||||
user_info = yield self.store.get_user_by_id(user_id)
|
user_info = yield self.store.get_user_by_id(user_id)
|
||||||
if len(user_info) > 0:
|
if not user_info:
|
||||||
defer.returnValue(False)
|
defer.returnValue(False)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -112,14 +112,14 @@ class RegistrationStore(SQLBaseStore):
|
|||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def user_delete_access_tokens_apart_from(self, user_id, token_id):
|
def user_delete_access_tokens_apart_from(self, user_id, token_id):
|
||||||
rows = yield self.get_user_by_id(user_id)
|
user = yield self.get_user_by_id(user_id)
|
||||||
if len(rows) == 0:
|
if not user:
|
||||||
raise Exception("No such user!")
|
raise Exception("No such user!")
|
||||||
|
|
||||||
yield self._execute(
|
yield self._execute(
|
||||||
"delete_access_tokens_apart_from", None,
|
"delete_access_tokens_apart_from", None,
|
||||||
"DELETE FROM access_tokens WHERE user_id = ? AND id != ?",
|
"DELETE FROM access_tokens WHERE user_id = ? AND id != ?",
|
||||||
rows[0]['id'], token_id
|
user['id'], token_id
|
||||||
)
|
)
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
|
Loading…
Reference in New Issue
Block a user