forked from MirrorHub/synapse
Fix pyflakes errors
This commit is contained in:
parent
892e70ec84
commit
a89b86dc47
2 changed files with 5 additions and 3 deletions
|
@ -16,6 +16,7 @@
|
||||||
from ._base import client_v2_pattern
|
from ._base import client_v2_pattern
|
||||||
|
|
||||||
from synapse.http.servlet import RestServlet
|
from synapse.http.servlet import RestServlet
|
||||||
|
from synapse.api.errors import AuthError
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
|
@ -56,6 +57,7 @@ class TagServlet(RestServlet):
|
||||||
PATTERN = client_v2_pattern(
|
PATTERN = client_v2_pattern(
|
||||||
"/user/(?P<user_id>[^/]*)/rooms/(?P<room_id>[^/]*)/tags/(?P<tag>[^/]*)"
|
"/user/(?P<user_id>[^/]*)/rooms/(?P<room_id>[^/]*)/tags/(?P<tag>[^/]*)"
|
||||||
)
|
)
|
||||||
|
|
||||||
def __init__(self, hs):
|
def __init__(self, hs):
|
||||||
super(TagServlet, self).__init__()
|
super(TagServlet, self).__init__()
|
||||||
self.auth = hs.get_auth()
|
self.auth = hs.get_auth()
|
||||||
|
|
|
@ -84,7 +84,7 @@ class TagsStore(SQLBaseStore):
|
||||||
results = {}
|
results = {}
|
||||||
if room_ids:
|
if room_ids:
|
||||||
tags_by_room = yield self.get_tags_for_user(self, user_id)
|
tags_by_room = yield self.get_tags_for_user(self, user_id)
|
||||||
for room_id in rooms_ids:
|
for room_id in room_ids:
|
||||||
results[room_id] = tags_by_room[room_id]
|
results[room_id] = tags_by_room[room_id]
|
||||||
|
|
||||||
defer.returnValue(results)
|
defer.returnValue(results)
|
||||||
|
@ -117,7 +117,7 @@ class TagsStore(SQLBaseStore):
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
txn.execute(sql, (user_id, room_id, tag))
|
txn.execute(sql, (user_id, room_id, tag))
|
||||||
except database_engine.module.IntegrityError as e:
|
except self.database_engine.module.IntegrityError:
|
||||||
# Return early if the row is already in the table
|
# Return early if the row is already in the table
|
||||||
# and we don't need to bump the revision number of the
|
# and we don't need to bump the revision number of the
|
||||||
# private_user_data.
|
# private_user_data.
|
||||||
|
@ -180,7 +180,7 @@ class TagsStore(SQLBaseStore):
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
txn.execute(insert_sql, (user_id, room_id, next_id))
|
txn.execute(insert_sql, (user_id, room_id, next_id))
|
||||||
except database_engine.module.IntegrityError as e:
|
except self.database_engine.module.IntegrityError:
|
||||||
# Ignore insertion errors. It doesn't matter if the row wasn't
|
# Ignore insertion errors. It doesn't matter if the row wasn't
|
||||||
# inserted because if two updates happend concurrently the one
|
# inserted because if two updates happend concurrently the one
|
||||||
# with the higher stream_id will not be reported to a client
|
# with the higher stream_id will not be reported to a client
|
||||||
|
|
Loading…
Reference in a new issue