[open-ils-commits] r151 - in servres/trunk/conifer: syrup templates/auth (gfawcett)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Mar 8 16:01:47 EDT 2009
Author: gfawcett
Date: 2009-03-08 16:01:43 -0400 (Sun, 08 Mar 2009)
New Revision: 151
Modified:
servres/trunk/conifer/syrup/views.py
servres/trunk/conifer/templates/auth/login.xhtml
Log:
better handling for not-defined items in Genshi
In days of yore, Genshi had special handling for references to
undefined variables. They were basically treated as null/empty values;
they would evaluate as False in tests; and they would display as
''. That changed out from underneath me, somewhere along the Genshi
path. The modern way is to use a test, "defined('foo')" before
attempting to access 'foo'.
Modified: servres/trunk/conifer/syrup/views.py
===================================================================
--- servres/trunk/conifer/syrup/views.py 2009-03-08 20:01:40 UTC (rev 150)
+++ servres/trunk/conifer/syrup/views.py 2009-03-08 20:01:43 UTC (rev 151)
@@ -27,12 +27,7 @@
return HttpResponseRedirect(next)
else:
return g.render('auth/login.xhtml',
- next=request.GET.get('next'),
- err=None # fixme, this shouldn't be
- # necessary. Genshi should treat
- # missing names as None, but something
- # is wrong.
- )
+ next=request.GET.get('next'))
else:
userid, password = request.POST['userid'], request.POST['password']
next = request.POST['next']
Modified: servres/trunk/conifer/templates/auth/login.xhtml
===================================================================
--- servres/trunk/conifer/templates/auth/login.xhtml 2009-03-08 20:01:40 UTC (rev 150)
+++ servres/trunk/conifer/templates/auth/login.xhtml 2009-03-08 20:01:43 UTC (rev 151)
@@ -15,7 +15,7 @@
<h1>Please log in.</h1>
<form action="." method="post">
<input type="hidden" name="next" value="${next}"/>
- <div class="errors" py:if="err">${err}</div>
+ <div class="errors" py:if="defined('err')">${err}</div>
<table>
<tr>
<th>User ID:</th>
More information about the open-ils-commits
mailing list