udata 11.0.2.dev20__py3-none-any.whl → 11.0.2.dev21__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.
Potentially problematic release.
This version of udata might be problematic. Click here for more details.
- udata/core/activity/models.py +3 -11
- udata/static/chunks/{10.8ca60413647062717b1e.js → 10.471164b2a9fe15614797.js} +3 -3
- udata/static/chunks/{10.8ca60413647062717b1e.js.map → 10.471164b2a9fe15614797.js.map} +1 -1
- udata/static/chunks/{11.b6f741fcc366abfad9c4.js → 11.0f04e49a40a0a381bcce.js} +3 -3
- udata/static/chunks/{11.b6f741fcc366abfad9c4.js.map → 11.0f04e49a40a0a381bcce.js.map} +1 -1
- udata/static/chunks/{13.2d06442dd9a05d9777b5.js → 13.39e106d56f794ebd06a0.js} +2 -2
- udata/static/chunks/{13.2d06442dd9a05d9777b5.js.map → 13.39e106d56f794ebd06a0.js.map} +1 -1
- udata/static/chunks/{17.e8e4caaad5cb0cc0bacc.js → 17.70cbb4a91b002338007e.js} +2 -2
- udata/static/chunks/{17.e8e4caaad5cb0cc0bacc.js.map → 17.70cbb4a91b002338007e.js.map} +1 -1
- udata/static/chunks/{19.f03a102365af4315f9db.js → 19.df16abde17a42033a7f8.js} +3 -3
- udata/static/chunks/{19.f03a102365af4315f9db.js.map → 19.df16abde17a42033a7f8.js.map} +1 -1
- udata/static/chunks/{8.778091d55cd8ea39af6b.js → 8.0f42630e6d8ff782928e.js} +2 -2
- udata/static/chunks/{8.778091d55cd8ea39af6b.js.map → 8.0f42630e6d8ff782928e.js.map} +1 -1
- udata/static/chunks/{9.033d7e190ca9e226a5d0.js → 9.07515e5187f475bce828.js} +3 -3
- udata/static/chunks/{9.033d7e190ca9e226a5d0.js.map → 9.07515e5187f475bce828.js.map} +1 -1
- udata/static/common.js +1 -1
- udata/static/common.js.map +1 -1
- udata/tests/test_activity.py +17 -0
- udata/utils.py +32 -1
- {udata-11.0.2.dev20.dist-info → udata-11.0.2.dev21.dist-info}/METADATA +1 -1
- {udata-11.0.2.dev20.dist-info → udata-11.0.2.dev21.dist-info}/RECORD +25 -25
- {udata-11.0.2.dev20.dist-info → udata-11.0.2.dev21.dist-info}/WHEEL +0 -0
- {udata-11.0.2.dev20.dist-info → udata-11.0.2.dev21.dist-info}/entry_points.txt +0 -0
- {udata-11.0.2.dev20.dist-info → udata-11.0.2.dev21.dist-info}/licenses/LICENSE +0 -0
- {udata-11.0.2.dev20.dist-info → udata-11.0.2.dev21.dist-info}/top_level.txt +0 -0
udata/core/activity/models.py
CHANGED
|
@@ -9,7 +9,7 @@ from mongoengine.signals import post_save
|
|
|
9
9
|
from udata.api_fields import get_fields
|
|
10
10
|
from udata.auth import current_user
|
|
11
11
|
from udata.mongo import db
|
|
12
|
-
from udata.utils import get_field_value_from_path
|
|
12
|
+
from udata.utils import filter_changed_fields, get_field_value_from_path
|
|
13
13
|
|
|
14
14
|
from .signals import new_activity
|
|
15
15
|
|
|
@@ -130,16 +130,8 @@ class Auditable(object):
|
|
|
130
130
|
cls.on_create.send(document)
|
|
131
131
|
elif len(changed_fields):
|
|
132
132
|
previous = getattr(document, "_previous_changed_fields", None)
|
|
133
|
-
#
|
|
134
|
-
|
|
135
|
-
# We compare them one by one with the previous value stored in _previous_changed_fields.
|
|
136
|
-
# See https://github.com/opendatateam/udata/pull/3412 for more context.
|
|
137
|
-
document.reload()
|
|
138
|
-
changed_fields = [
|
|
139
|
-
field
|
|
140
|
-
for field in changed_fields
|
|
141
|
-
if previous[field] != get_field_value_from_path(document, field)
|
|
142
|
-
]
|
|
133
|
+
# Filter changed_fields since mongoengine raises some false positive occurences
|
|
134
|
+
changed_fields = filter_changed_fields(document, previous, changed_fields)
|
|
143
135
|
if changed_fields:
|
|
144
136
|
cls.on_update.send(document, changed_fields=changed_fields, previous=previous)
|
|
145
137
|
if getattr(document, "deleted_at", None) or getattr(document, "deleted", None):
|