accrete 0.0.113__py3-none-any.whl → 0.0.115__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ from django.conf import settings
2
+
3
+ ACCRETE_LOG_RUN_IN_MIGRATION = getattr(
4
+ settings, 'ACCRETE_LOG_RUN_IN_MIGRATION',
5
+ False
6
+ )
@@ -5,13 +5,18 @@ from django.db import models
5
5
  from accrete.tenant import get_member, get_tenant
6
6
  from accrete.utils.log import log_time
7
7
  from .models import Log, LogConfig
8
- from . import helper, queries
8
+ from . import helper, queries, config
9
9
 
10
10
  _logger = logging.getLogger(__name__)
11
11
 
12
12
 
13
13
  @log_time
14
14
  def create_log(sender, **kwargs):
15
+ if (
16
+ sender._meta.object_name == 'Migrate'
17
+ and not config.ACCRETE_LOG_RUN_IN_MIGRATION
18
+ ):
19
+ return
15
20
 
16
21
  def _create_log():
17
22
  member = get_member()
@@ -51,7 +56,6 @@ def create_log(sender, **kwargs):
51
56
  log_config = LogConfig.objects.filter(model=model).first()
52
57
  if not log_config:
53
58
  return
54
-
55
59
  try:
56
60
  _create_log()
57
61
  except Exception as e:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: accrete
3
- Version: 0.0.113
3
+ Version: 0.0.115
4
4
  Summary: Django Shared Schema Multi Tenant
5
5
  Author-email: Benedikt Jilek <benedikt.jilek@pm.me>
6
6
  License: Copyright (c) 2023 Benedikt Jilek
@@ -15,10 +15,11 @@ accrete/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  accrete/contrib/log/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  accrete/contrib/log/admin.py,sha256=a3VCS2_YmahBShewMS9yn1QOln-3rmCJqMsa6VnNqdU,1151
17
17
  accrete/contrib/log/apps.py,sha256=O0Cje3MmpxPToJVgO195lBg0tRCy9Ou87-ntcdGBKM0,369
18
+ accrete/contrib/log/config.py,sha256=vRzPVbiUfpo5NGtgiJv5mEKR_h3qsYI_brxjni6-Z-Y,132
18
19
  accrete/contrib/log/helper.py,sha256=Zzmwxz7vP0jdW2LCw8gDpPNBkqlELaCydz-nxGh7F5Y,2493
19
20
  accrete/contrib/log/models.py,sha256=PUGtm2mmZIhWf7Idpu9hZ-1mJtKU2p975e7eoCZ2cHE,6082
20
21
  accrete/contrib/log/queries.py,sha256=JMI_q6dQ0JjyORtfRPOW92of45TFxqPiwIhHEEar34o,1126
21
- accrete/contrib/log/signals.py,sha256=Gsb7B9nRhLgQQ8qxtbCEnvgHkFK9v7JfYJfAupFQ21I,2036
22
+ accrete/contrib/log/signals.py,sha256=uwoNrBUW7zPiC185-pyGSMJrjZ4P_VqBp5ZelDEkOh8,2172
22
23
  accrete/contrib/log/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
23
24
  accrete/contrib/log/views.py,sha256=xc1IQHrsij7j33TUbo-_oewy3vs03pw_etpBWaMYJl0,63
24
25
  accrete/contrib/log/migrations/0001_initial.py,sha256=wkGMfaYc09dOuJXY0JengDBTkS98rMutUzmEAb6eK3E,2130
@@ -380,7 +381,7 @@ accrete/utils/forms.py,sha256=IvxbXNpSd4a-JBgsTJhs2GHe-DCRWX-xnVPRcoiCzbI,3104
380
381
  accrete/utils/log.py,sha256=BH0MBDweAjx30wGBO4F3sFhbgkSoEs7T1lLLjlYZNnA,407
381
382
  accrete/utils/models.py,sha256=2xTacvcpmDK_Bp4rAK7JdVLf8HU009LYNJ6eSpMgYZI,1014
382
383
  accrete/utils/views.py,sha256=AutijWetWGgjdO1PNc4gxCblT-i1fAfldNDFRbO9Sac,5012
383
- accrete-0.0.113.dist-info/METADATA,sha256=kvqYem5bYx1j0oWAFyHESNnmukLdsBxfiu-kc-PDB-k,4953
384
- accrete-0.0.113.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
385
- accrete-0.0.113.dist-info/licenses/LICENSE,sha256=_7laeMIHnsd3Y2vJEXDYXq_PEXxIcjgJsGt8UIKTRWc,1057
386
- accrete-0.0.113.dist-info/RECORD,,
384
+ accrete-0.0.115.dist-info/METADATA,sha256=F0RIvdOoTzHqszyXhU_NaQmv8-1-q_bFIZq0MUamEsA,4953
385
+ accrete-0.0.115.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
386
+ accrete-0.0.115.dist-info/licenses/LICENSE,sha256=_7laeMIHnsd3Y2vJEXDYXq_PEXxIcjgJsGt8UIKTRWc,1057
387
+ accrete-0.0.115.dist-info/RECORD,,