From 5b8a71a4d21a5ee35694718804dda7820f13f768 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 12 Feb 2007 04:02:07 +0000 Subject: [PATCH 1/1] =?utf8?q?Bugfix.=20S=C3=B3lo=20ReSTifica=20si=20no=20?= =?utf8?q?es=20None.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- sercom/subcontrollers/docente/__init__.py | 7 +++++-- sercom/subcontrollers/enunciado/__init__.py | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) 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() -- 2.43.0