use default_format when saving label profiles

This commit is contained in:
Lance Edgar 2012-11-26 16:27:18 -08:00
parent 472d2cfd7b
commit 765fa7f949

View file

@ -114,6 +114,16 @@ class ProfileCrud(CrudView):
])
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):
return self.request.route_url('label_profile.read',
uuid=form.fieldset.model.uuid)