Updated shared content add form
authorThierry Florac <tflorac@ulthar.net>
Fri, 20 Jul 2018 01:02:27 +0200
changeset 872 c9f708af6069
parent 871 d7ad1624cc4f
child 873 5f40601f9cb0
Updated shared content add form
src/pyams_content/shared/common/zmi/__init__.py
--- a/src/pyams_content/shared/common/zmi/__init__.py	Fri Jul 20 01:02:00 2018 +0200
+++ b/src/pyams_content/shared/common/zmi/__init__.py	Fri Jul 20 01:02:27 2018 +0200
@@ -87,12 +87,12 @@
         return self.context.shared_content_factory.content_class()
 
     def update_content(self, content, data):
-        # generic content update
         changes = super(SharedContentAddForm, self).update_content(content, data)
+        # initialize content fields
+        lang = get_utility(INegotiator).server_language
         content.creator = self.request.principal.id
         content.owner = self.request.principal.id
         content.short_name = content.title.copy()
-        lang = get_utility(INegotiator).server_language
         content.content_url = generate_url(content.title.get(lang, ''))
         # init content languages
         languages = II18nManager(self.context).languages