forms: update URL of imported forms without testing for existing data (#8262)

This commit is contained in:
Frédéric Péters 2015-09-14 17:17:28 +02:00
parent f10dc8fad4
commit 762c9f36fe
1 changed files with 4 additions and 3 deletions

View File

@ -248,10 +248,11 @@ class FormDef(StorableObject):
if not self.url_name:
self.url_name = new_url_name
if new_url_name != self.url_name:
# title changed, url will be changed only if there are not yet any
# submitted forms
# title changed, url will be changed only if the formdef is
# currently being imported (self.id is None) or if there are not
# yet any submitted forms
data_class = self.data_class()
if data_class().count() == 0:
if self.id is None or data_class().count() == 0:
self.url_name = new_url_name
self.last_modification_time = time.localtime()
if get_request() and get_request().user: