Skip to content

Commit 4fe3e9d

Browse files
committed
circular import issue
1 parent 3f714e5 commit 4fe3e9d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

sogs/mule.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def setup_omq(self, omq: OMQ):
111111
omq.mule_conn = omq.connect_inproc(on_success=None, on_failure=self.inproc_fail)
112112

113113

114+
114115
"""
115116
TOFIX: oxenmq calls should pass as oxenmq.Message not as JSON
116117

sogs/routes/legacy.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from werkzeug.exceptions import HTTPException
33
from ..web import app
44
from .. import crypto, config, db, http, utils
5-
from ..omq import omq_global
65
from ..utils import jsonify_with_base64
76
from ..model.room import Room, get_accessible_rooms, get_deletions_deprecated
87
from ..model.user import User
@@ -321,6 +320,12 @@ def handle_legacy_delete_messages(ids=None):
321320
ids = room.delete_posts(ids, user)
322321

323322
if ids:
323+
# avoid circular imports
324+
try:
325+
from ..omq import omq_global
326+
except ModuleNotFoundError:
327+
return
328+
324329
omq_global.send_mule("messages_deleted", ids)
325330

326331
return jsonify({'status_code': http.OK})

0 commit comments

Comments
 (0)