accrete 0.0.97__py3-none-any.whl → 0.0.98__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.
- accrete/managers.py +8 -5
- {accrete-0.0.97.dist-info → accrete-0.0.98.dist-info}/METADATA +1 -1
- {accrete-0.0.97.dist-info → accrete-0.0.98.dist-info}/RECORD +5 -5
- {accrete-0.0.97.dist-info → accrete-0.0.98.dist-info}/WHEEL +0 -0
- {accrete-0.0.97.dist-info → accrete-0.0.98.dist-info}/licenses/LICENSE +0 -0
accrete/managers.py
CHANGED
@@ -23,15 +23,18 @@ class TenantManager(models.Manager, AnnotationManagerMixin):
|
|
23
23
|
tenant = get_tenant()
|
24
24
|
if tenant is None and any(obj.tenant_id in (False, None) for obj in objs):
|
25
25
|
raise ValueError(
|
26
|
-
'Tenant must be set for all objects when calling
|
26
|
+
'Tenant must be set for all objects when calling '
|
27
|
+
'bulk_create without an active tenant set.'
|
27
28
|
)
|
29
|
+
list(map(
|
30
|
+
lambda x: setattr(x, 'tenant_id', tenant.pk),
|
31
|
+
filter(lambda o: o.tenant_id is None, objs)
|
32
|
+
))
|
28
33
|
if tenant is not None and any(obj.tenant_id != tenant.pk for obj in objs):
|
29
34
|
raise ValueError(
|
30
|
-
'Objects must have set the
|
35
|
+
'Objects must have set the active Tenant when calling '
|
36
|
+
'bulk_create while a tenant is active.'
|
31
37
|
)
|
32
|
-
elif tenant is not None:
|
33
|
-
for obj in objs:
|
34
|
-
obj.tenant_id = tenant.pk
|
35
38
|
return super().bulk_create(
|
36
39
|
objs, batch_size=batch_size, ignore_conflicts=ignore_conflicts,
|
37
40
|
update_conflicts=update_conflicts, update_fields=update_fields,
|
@@ -4,7 +4,7 @@ accrete/annotation.py,sha256=GCpTTX3fJH9w2vOOOydKcAALdEd1gRNjh_Ws9LkJ4aA,1355
|
|
4
4
|
accrete/apps.py,sha256=F7ynMLHJr_6bRujWtZVUzCliY2CGKiDvyUmL4F68L2E,146
|
5
5
|
accrete/config.py,sha256=eJUbvyBO3DvAD6xkVKjTAzlXy7V7EK9bVyb91girfUs,299
|
6
6
|
accrete/forms.py,sha256=2vUh80qNvPDD8Zl3agKBSJEQeY7bXVLOx_SAB34wf8E,1359
|
7
|
-
accrete/managers.py,sha256=
|
7
|
+
accrete/managers.py,sha256=oZOA45HViNstaeIaGD2szg717DwByifW5GfvVsi4hOk,1561
|
8
8
|
accrete/middleware.py,sha256=NhtT3YPq0EynAi4F81LLLUZd5rsWDjGVn1tkgUObT3M,3477
|
9
9
|
accrete/models.py,sha256=xliEVR0XPW46ZDJn3-F46s54tG9dxz7BVLbkq1pC144,5434
|
10
10
|
accrete/storage.py,sha256=z7pHdQFw0hFGrrbfqIh7KFxabQ_JGqoPebmiX9TLmeU,1254
|
@@ -233,7 +233,7 @@ accrete/utils/forms.py,sha256=IvxbXNpSd4a-JBgsTJhs2GHe-DCRWX-xnVPRcoiCzbI,3104
|
|
233
233
|
accrete/utils/log.py,sha256=BH0MBDweAjx30wGBO4F3sFhbgkSoEs7T1lLLjlYZNnA,407
|
234
234
|
accrete/utils/models.py,sha256=EEhv7-sQVtQD24PEb3XcDUAh3VVhVFoMMLyFrDjGEaI,706
|
235
235
|
accrete/utils/views.py,sha256=iWZSYbd3qYMrV9wAsX26ofGb5wxn1N_nRrQ6s2lpp2I,4557
|
236
|
-
accrete-0.0.
|
237
|
-
accrete-0.0.
|
238
|
-
accrete-0.0.
|
239
|
-
accrete-0.0.
|
236
|
+
accrete-0.0.98.dist-info/METADATA,sha256=fCH0M8A4xpBgNS0cKIabZniRe1bCSLTdklUwVD6DwU0,4952
|
237
|
+
accrete-0.0.98.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
238
|
+
accrete-0.0.98.dist-info/licenses/LICENSE,sha256=_7laeMIHnsd3Y2vJEXDYXq_PEXxIcjgJsGt8UIKTRWc,1057
|
239
|
+
accrete-0.0.98.dist-info/RECORD,,
|
File without changes
|
File without changes
|