Selaa lähdekoodia

prevent cyclic import

Bastien Sevajol (Algoo) 8 vuotta sitten
vanhempi
commit
cfb387c9f9
2 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 1 1
      tracim/tracim/model/auth.py
  2. 1 1
      tracim/tracim/model/data.py

+ 1 - 1
tracim/tracim/model/auth.py Näytä tiedosto

@@ -28,7 +28,6 @@ from sqlalchemy.types import DateTime
28 28
 from sqlalchemy.types import Boolean
29 29
 from sqlalchemy.orm import relation, relationship, synonym
30 30
 from tg import request
31
-from tracim.lib.calendar import CALENDAR_USER_URL_TEMPLATE
32 31
 from tracim.model import DeclarativeBase, metadata, DBSession
33 32
 
34 33
 # This is the association table for the many-to-many relationship between
@@ -153,6 +152,7 @@ class User(DeclarativeBase):
153 152
     def calendar_url(self) -> str:
154 153
         # TODO - 20160531 - Bastien: Cyclic import if import in top of file
155 154
         from tracim.config.app_cfg import CFG
155
+        from tracim.lib.calendar import CALENDAR_USER_URL_TEMPLATE
156 156
         cfg = CFG.get_instance()
157 157
         return CALENDAR_USER_URL_TEMPLATE.format(
158 158
             proto='https' if cfg.RADICALE_CLIENT_SSL else 'http',

+ 1 - 1
tracim/tracim/model/data.py Näytä tiedosto

@@ -26,7 +26,6 @@ from sqlalchemy.types import Text
26 26
 from sqlalchemy.types import Unicode
27 27
 from tg.i18n import lazy_ugettext as l_, ugettext as _
28 28
 
29
-from tracim.lib.calendar import CALENDAR_WORKSPACE_URL_TEMPLATE
30 29
 from tracim.lib.exception import ContentRevisionUpdateError
31 30
 from tracim.model import DeclarativeBase, RevisionsIntegrity
32 31
 from tracim.model.auth import User
@@ -72,6 +71,7 @@ class Workspace(DeclarativeBase):
72 71
     def calendar_url(self) -> str:
73 72
         # TODO - 20160531 - Bastien: Cyclic import if import in top of file
74 73
         from tracim.config.app_cfg import CFG
74
+        from tracim.lib.calendar import CALENDAR_WORKSPACE_URL_TEMPLATE
75 75
         cfg = CFG.get_instance()
76 76
         return CALENDAR_WORKSPACE_URL_TEMPLATE.format(
77 77
             proto='https' if cfg.RADICALE_CLIENT_SSL else 'http',