[PATCH 1 of 5 timesheet] [views] Fix ImportError

Simon Chabot simon.chabot at logilab.fr
Thu Mar 5 16:16:53 CET 2020


# HG changeset patch
# User Philippe Pepiot <philippe.pepiot at logilab.fr>
# Date 1581584761 -3600
#      Thu Feb 13 10:06:01 2020 +0100
# Node ID 1a8777a303367e5a69b0259a0f8e14434daa6c37
# Parent  22eead94c641e1e96c401f0d861b9af13694b0e2
# Available At https://hg.logilab.org/review/cubes/timesheet/
#              hg pull https://hg.logilab.org/review/cubes/timesheet/ -r 1a8777a30336
[views] Fix ImportError

cubicweb.uilib.printable_value() is deprecated since cubicweb 3.14, and has been dropped in 3.27.
We should use req.printable_value() instead.

diff -r 22eead94c641 -r 1a8777a30336 cubicweb_timesheet/views/euser.py
--- a/cubicweb_timesheet/views/euser.py	Wed Dec 11 11:57:20 2019 +0100
+++ b/cubicweb_timesheet/views/euser.py	Thu Feb 13 10:06:01 2020 +0100
@@ -8,7 +8,6 @@
 from cubicweb import _
 from cubicweb.view import EntityView
 from cubicweb.predicates import is_instance, one_line_rset
-from cubicweb.uilib import printable_value
 from cubicweb.web import form
 from cubicweb.web.views import json
 
@@ -220,7 +219,7 @@
             cssclass = u'missing' if declared < expected else u'toomuch'
             w(u'<tr><td><a href="%s">%s</a></td><td>%s</td><td class="%s">%s</td><td>%s</td></tr>' %
               (xml_escape(act_url),
-               printable_value(self._cw, 'Date', day), expected,
+               self._cw.printable_value('Date', day), expected,
                cssclass, declared, xml_escape(summary)))
         w(u'</table>')
 



More information about the cubicweb-devel mailing list