From: Leandro Lucarella Date: Mon, 12 Feb 2007 04:02:07 +0000 (+0000) Subject: Bugfix. Sólo ReSTifica si no es None. X-Git-Tag: pre-merge~150 X-Git-Url: https://git.llucax.com/software/sercom.git/commitdiff_plain/5b8a71a4d21a5ee35694718804dda7820f13f768?hp=6526a74b42e33e807f8e3846f38b28ef1f5de534 Bugfix. Sólo ReSTifica si no es None. --- diff --git a/sercom/subcontrollers/docente/__init__.py b/sercom/subcontrollers/docente/__init__.py index a167d7a..d7d58bc 100644 --- a/sercom/subcontrollers/docente/__init__.py +++ b/sercom/subcontrollers/docente/__init__.py @@ -2,12 +2,12 @@ from turbogears import controllers, expose, redirect from turbogears import validate, validators, flash, error_handler -from sercom.model import Docente from turbogears.widgets import * 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 Docente cls = Docente name = 'docente' @@ -108,7 +108,10 @@ class DocenteController(controllers.Controller, identity.SecureResource): def show(self,id, **kw): """Show record in model""" r = validate_get(id) - r.obs = publish_parts(r.observaciones, writer_name='html')['html_body'] + if r.observaciones is None: + r.obs = '' + else: + r.obs = publish_parts(r.observaciones, writer_name='html')['html_body'] return dict(name=name, namepl=namepl, record=r) @expose() diff --git a/sercom/subcontrollers/enunciado/__init__.py b/sercom/subcontrollers/enunciado/__init__.py index 2ac3435..5016aad 100644 --- a/sercom/subcontrollers/enunciado/__init__.py +++ b/sercom/subcontrollers/enunciado/__init__.py @@ -2,12 +2,12 @@ from turbogears import controllers, expose, redirect from turbogears import validate, validators, flash, error_handler -from sercom.model import Enunciado, Docente from turbogears.widgets import * 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 Enunciado, Docente cls = Enunciado name = 'enunciado' @@ -105,7 +105,10 @@ class EnunciadoController(controllers.Controller, identity.SecureResource): def show(self,id, **kw): """Show record in model""" r = validate_get(id) - r.desc = publish_parts(r.descripcion, writer_name='html')['html_body'] + if r.descripcion is None: + r.desc = '' + else: + r.desc = publish_parts(r.descripcion, writer_name='html')['html_body'] return dict(name=name, namepl=namepl, record=r) @expose()