- print row[1]
- u = Alumno(row[0], nombre=row[1])
- u.email = row[2]
- u.telefono = row[3]
- u.contrasenia = row[0]
- u.activo = True
- raise redirect('./list')
+ try:
+ u = Alumno(row[0], nombre=row[1])
+ u.email = row[2]
+ u.telefono = row[3]
+ u.password = row[0]
+ u.activo = True
+ u.add_rol(entregador)
+ ok.append(row)
+ except Exception, e:
+ row.append(str(e))
+ fail.append(row)
+ return dict(ok=ok, fail=fail)
+
+ @expose('json')
+ def get_alumno(self, padron):
+ msg = u''
+ error=False
+ try:
+ # Busco el alumno inscripto
+ alumno = Alumno.byPadron(padron=padron)
+ msg = {}
+ msg['id'] = alumno.id
+ msg['value'] = alumno.shortrepr()
+ except SQLObjectNotFound:
+ msg = 'No existe el alumno con padron: %s.' % padron
+ error=True
+ except Exception, (inst):
+ msg = u"""Se ha producido un error inesperado al buscar el registro:\n %s""" % str(inst)
+ error = True
+ return dict(msg=msg, error=error)
+
+