udata 11.0.1.dev37741__py2.py3-none-any.whl → 11.0.2.dev37787__py2.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.

Files changed (25) hide show
  1. udata/__init__.py +1 -1
  2. udata/core/topic/forms.py +17 -14
  3. udata/static/chunks/{10.8ca60413647062717b1e.js → 10.471164b2a9fe15614797.js} +3 -3
  4. udata/static/chunks/{10.8ca60413647062717b1e.js.map → 10.471164b2a9fe15614797.js.map} +1 -1
  5. udata/static/chunks/{11.b6f741fcc366abfad9c4.js → 11.83535504cd650ea08f65.js} +3 -3
  6. udata/static/chunks/{11.b6f741fcc366abfad9c4.js.map → 11.83535504cd650ea08f65.js.map} +1 -1
  7. udata/static/chunks/{13.2d06442dd9a05d9777b5.js → 13.d9c1735d14038b94c17e.js} +2 -2
  8. udata/static/chunks/{13.2d06442dd9a05d9777b5.js.map → 13.d9c1735d14038b94c17e.js.map} +1 -1
  9. udata/static/chunks/{17.e8e4caaad5cb0cc0bacc.js → 17.81c57c0dedf812e43013.js} +2 -2
  10. udata/static/chunks/{17.e8e4caaad5cb0cc0bacc.js.map → 17.81c57c0dedf812e43013.js.map} +1 -1
  11. udata/static/chunks/{19.f03a102365af4315f9db.js → 19.df16abde17a42033a7f8.js} +3 -3
  12. udata/static/chunks/{19.f03a102365af4315f9db.js.map → 19.df16abde17a42033a7f8.js.map} +1 -1
  13. udata/static/chunks/{8.778091d55cd8ea39af6b.js → 8.462bb3029de008497675.js} +2 -2
  14. udata/static/chunks/{8.778091d55cd8ea39af6b.js.map → 8.462bb3029de008497675.js.map} +1 -1
  15. udata/static/chunks/{9.033d7e190ca9e226a5d0.js → 9.07515e5187f475bce828.js} +3 -3
  16. udata/static/chunks/{9.033d7e190ca9e226a5d0.js.map → 9.07515e5187f475bce828.js.map} +1 -1
  17. udata/static/common.js +1 -1
  18. udata/static/common.js.map +1 -1
  19. udata/tests/apiv2/test_topics.py +26 -0
  20. {udata-11.0.1.dev37741.dist-info → udata-11.0.2.dev37787.dist-info}/METADATA +5 -1
  21. {udata-11.0.1.dev37741.dist-info → udata-11.0.2.dev37787.dist-info}/RECORD +25 -25
  22. {udata-11.0.1.dev37741.dist-info → udata-11.0.2.dev37787.dist-info}/LICENSE +0 -0
  23. {udata-11.0.1.dev37741.dist-info → udata-11.0.2.dev37787.dist-info}/WHEEL +0 -0
  24. {udata-11.0.1.dev37741.dist-info → udata-11.0.2.dev37787.dist-info}/entry_points.txt +0 -0
  25. {udata-11.0.1.dev37741.dist-info → udata-11.0.2.dev37787.dist-info}/top_level.txt +0 -0
udata/__init__.py CHANGED
@@ -4,5 +4,5 @@
4
4
  udata
5
5
  """
6
6
 
7
- __version__ = "11.0.1.dev"
7
+ __version__ = "11.0.2.dev"
8
8
  __description__ = "Open data portal"
udata/core/topic/forms.py CHANGED
@@ -58,24 +58,27 @@ class TopicForm(ModelForm):
58
58
  """Custom save to handle TopicElement creation properly"""
59
59
  # Store elements data before parent save
60
60
  elements_data = self.elements.data
61
+ # Check if elements field was explicitly provided
62
+ elements_provided = self.elements.has_data
61
63
 
62
64
  # Use parent save method (elements field is excluded via populate_obj)
63
65
  topic = super().save(commit=commit, **kwargs)
64
66
 
65
- # Clear existing elements before adding new ones
66
- if commit:
67
- TopicElement.objects(topic=topic).delete()
68
-
69
- # Create elements and associate them with the topic
70
- for element_data in elements_data or []:
71
- # Create element form with only its own data, not inheriting from parent
72
- element_form = TopicElementForm(meta={"csrf": False})
73
- element_form.process(data=element_data)
74
- if element_form.validate():
75
- element = element_form.save(commit=False)
76
- element.topic = topic
77
- if commit:
78
- element.save()
67
+ # Only clear and recreate elements if they were explicitly provided in the payload
68
+ if elements_provided:
69
+ if commit:
70
+ TopicElement.objects(topic=topic).delete()
71
+
72
+ # Create elements and associate them with the topic
73
+ for element_data in elements_data or []:
74
+ # Create element form with only its own data, not inheriting from parent
75
+ element_form = TopicElementForm(meta={"csrf": False})
76
+ element_form.process(data=element_data)
77
+ if element_form.validate():
78
+ element = element_form.save(commit=False)
79
+ element.topic = topic
80
+ if commit:
81
+ element.save()
79
82
 
80
83
  return topic
81
84