Ver código fonte

prevent cyclic import

Bastien Sevajol (Algoo) 9 anos atrás
pai
commit
cfb387c9f9
2 arquivos alterados com 2 adições e 2 exclusões
  1. 1 1
      tracim/tracim/model/auth.py
  2. 1 1
      tracim/tracim/model/data.py

+ 1 - 1
tracim/tracim/model/auth.py Ver arquivo

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

+ 1 - 1
tracim/tracim/model/data.py Ver arquivo

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