[Python-checkins] r88946 - in tracker/instances/python-dev: detectors/userauditor.py html/issue.item.html html/user.item.html schema.py
martin.v.loewis
python-checkins at python.org
Wed Apr 11 16:41:35 CEST 2012
Author: martin.v.loewis
Date: Wed Apr 11 16:41:35 2012
New Revision: 88946
Log:
Issue 456: Provide home page URL for committer.
Modified:
tracker/instances/python-dev/detectors/userauditor.py
tracker/instances/python-dev/html/issue.item.html
tracker/instances/python-dev/html/user.item.html
tracker/instances/python-dev/schema.py
Modified: tracker/instances/python-dev/detectors/userauditor.py
==============================================================================
--- tracker/instances/python-dev/detectors/userauditor.py (original)
+++ tracker/instances/python-dev/detectors/userauditor.py Wed Apr 11 16:41:35 2012
@@ -20,6 +20,8 @@
#
#$Id: userauditor.py,v 1.3 2006/09/18 03:24:38 tobias-herp Exp $
+import urlparse
+
def audit_user_fields(db, cl, nodeid, newvalues):
''' Make sure user properties are valid.
@@ -39,6 +41,10 @@
if not "admin" in [x.lower().strip() for x in cl.get(nodeid, 'roles').split(",")]:
raise ValueError, "Only Admins may assign the Admin role!"
+ if newvalues.get('homepage'):
+ scheme = urlparse.urlparse(newvalues['homepage'])[0]
+ if scheme not in ('http', 'https'):
+ raise ValueError, "Invalid URL scheme in homepage URL"
def init(db):
# fire before changes are made
Modified: tracker/instances/python-dev/html/issue.item.html
==============================================================================
--- tracker/instances/python-dev/html/issue.item.html (original)
+++ tracker/instances/python-dev/html/issue.item.html Wed Apr 11 16:41:35 2012
@@ -310,7 +310,10 @@
<a tal:content="mid" tal:attributes="id mid;
href string:#$mid;"></a> - <a tal:attributes="href mid">(view)</a></th>
<th i18n:translate="">Author: <tal:x replace="python:msg.author.realname.plain(unchecked=1)"
- i18n:name="author" /> (<tal:x replace="msg/author"/>)
+ i18n:name="author" /> (<a tal:condition="msg/author/homepage"
+ tal:attributes="href msg/author/homepage"
+ tal:content="msg/author"/><tal:x
+ condition="not:msg/author/homepage" content="msg/author"/>)
<tal:if condition="msg/author/contrib_form"><span title="Contributor form received">*</span></tal:if>
<tal:if condition="msg/author/iscommitter">
<img src="@@file/committer.png" title="Python committer" alt="(Python committer)"/>
Modified: tracker/instances/python-dev/html/user.item.html
==============================================================================
--- tracker/instances/python-dev/html/user.item.html (original)
+++ tracker/instances/python-dev/html/user.item.html Wed Apr 11 16:41:35 2012
@@ -108,6 +108,11 @@
</td>
</tr>
+ <tr tal:define="name string:homepage; label string:Homepage; value context/homepage">
+ <th metal:use-macro="th_label">Home page</th>
+ <td><input name="organisation" metal:use-macro="normal_input"></td>
+ </tr>
+
<tr>
<th>Contributor Form Received</th>
<td><span tal:replace="structure context/contrib_form/field"/>
Modified: tracker/instances/python-dev/schema.py
==============================================================================
--- tracker/instances/python-dev/schema.py (original)
+++ tracker/instances/python-dev/schema.py Wed Apr 11 16:41:35 2012
@@ -96,6 +96,7 @@
contrib_form_date=Date(),
openids=String(), # space separated list
iscommitter=Boolean(),
+ homepage=String(),
)
user.setkey("username")
db.security.addPermission(name='Register', klass='user',
More information about the Python-checkins
mailing list