Commits

Anonymous committed 3769850

Issue 456: Provide home page URL for committer.

Comments (0)

Files changed (4)

detectors/userauditor.py

 #
 #$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.
 
             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

html/issue.item.html

      <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)"/>

html/user.item.html

   </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"/>
              contrib_form_date=Date(),
              openids=String(), # space separated list
              iscommitter=Boolean(),
+             homepage=String(),
              )
 user.setkey("username")
 db.security.addPermission(name='Register', klass='user',