def save(_handler, artigo_id=None, **artigo_properties): cmd = facade.save_artigo_cmd(**artigo_properties) try: cmd() except CommandExecutionException: context = {'errors': cmd.errors, 'artigo': cmd.form} return TemplateResponse(context, 'artigos/admin/form.html') _handler.redirect(router.to_path(admin))
def save(**artigo_properties): cmd = facade.save_artigo_cmd(**artigo_properties) return _save_or_update_json_response(cmd)