use default_format when saving label profiles
This commit is contained in:
parent
472d2cfd7b
commit
765fa7f949
|
@ -114,6 +114,16 @@ class ProfileCrud(CrudView):
|
||||||
])
|
])
|
||||||
return fs
|
return fs
|
||||||
|
|
||||||
|
def post_save(self, form):
|
||||||
|
profile = form.fieldset.model
|
||||||
|
if not profile.format:
|
||||||
|
formatter = profile.get_formatter()
|
||||||
|
if formatter:
|
||||||
|
try:
|
||||||
|
profile.format = formatter.default_format
|
||||||
|
except NotImplementedError:
|
||||||
|
pass
|
||||||
|
|
||||||
def post_save_url(self, form):
|
def post_save_url(self, form):
|
||||||
return self.request.route_url('label_profile.read',
|
return self.request.route_url('label_profile.read',
|
||||||
uuid=form.fieldset.model.uuid)
|
uuid=form.fieldset.model.uuid)
|
||||||
|
|
Loading…
Reference in a new issue