X-Git-Url: https://git.llucax.com/z.facultad/75.52/sercom.git/blobdiff_plain/122c4ab29a7c77ce1a32f1b8b1c41ea49d3c9938..a0674923171dc6dc48da9b5259b3a71f18e92f8b:/sercom/subcontrollers/validate.py?ds=sidebyside diff --git a/sercom/subcontrollers/validate.py b/sercom/subcontrollers/validate.py index 524f311..9b4a96a 100644 --- a/sercom/subcontrollers/validate.py +++ b/sercom/subcontrollers/validate.py @@ -43,3 +43,11 @@ def validate_new(cls, name, data, url='new'): u'inválido (error: %s).') % (name, e)) raise redirect(url, **data) +def validate_del(cls, name, id): + try: + id = int(id) + r = validate_get(cls, name, id) + r.destroySelf() + except Exception, e: + flash(_(u'No se pudo eliminar el %s: %s' % (name, e))) + raise redirect('../list')