X-Git-Url: https://git.llucax.com/z.facultad/75.52/sercom.git/blobdiff_plain/2c2bc622008bd1611d3bf7f8a5a4c88a7544912e..14d0be1bacc499e7fc46a0963197feeafccb1c97:/sercom/subcontrollers/alumno/__init__.py diff --git a/sercom/subcontrollers/alumno/__init__.py b/sercom/subcontrollers/alumno/__init__.py index 155c781..2eb418f 100644 --- a/sercom/subcontrollers/alumno/__init__.py +++ b/sercom/subcontrollers/alumno/__init__.py @@ -10,7 +10,7 @@ from turbogears import identity from turbogears import paginate from docutils.core import publish_parts from sercom.subcontrollers import validate as val -from sercom.model import Alumno +from sercom.model import Alumno, Rol from sqlobject import * #}}} @@ -157,6 +157,7 @@ class AlumnoController(controllers.Controller, identity.SecureResource): lines = archivo.file.read().split('\n') ok = [] fail = [] + entregador = Rol.get(2) for line in lines: for row in csv.reader([line]): if row == []: @@ -165,8 +166,9 @@ class AlumnoController(controllers.Controller, identity.SecureResource): u = Alumno(row[0], nombre=row[1]) u.email = row[2] u.telefono = row[3] - u.contrasenia = row[0] + u.password = row[0] u.activo = True + u.add_rol(entregador) ok.append(row) except Exception, e: row.append(str(e))