Beispiel #1
0
def save(_handler, clothing_id=None, **clothing_properties):
    cmd = facade.save_clothing_cmd(**clothing_properties)
    try:
        cmd()
    except CommandExecutionException:
        context = {'errors': cmd.errors,
                   'clothing': cmd.form}

        return TemplateResponse(context, 'clothings/admin/form.html')
    _handler.redirect(router.to_path(admin))
Beispiel #2
0
def save(**clothing_properties):
    cmd = facade.save_clothing_cmd(**clothing_properties)
    return _save_or_update_json_response(cmd)