]> git.ipfire.org Git - pbs.git/commitdiff
Drop format_email function which cannot handle User instances
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Jan 2018 16:29:13 +0000 (16:29 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Jan 2018 16:29:13 +0000 (16:29 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/misc.py
src/templates/modules/bugs-table.html
src/templates/modules/commits-table.html
src/web/base.py

index 8629dd36ec29925e6a31c056b60b1f60afd532d1..3f780564824fde7894fdaf51c6cd62f6b24605c7 100644 (file)
@@ -49,21 +49,6 @@ def friendly_time(t):
 
        return " ".join(ret)
 
-def format_email(email):
-       m = re.match(r"(.*) <(.*)>", email)
-       if m:
-               fmt = {
-                       "name" : xhtml_escape(m.group(1)),
-                       "mail" : xhtml_escape(m.group(2)),
-               }
-       else:
-               fmt = {
-                       "name" : xhtml_escape(email),
-                       "mail" : xhtml_escape(email),
-               }
-
-       return """<a class="email" href="mailto:%(mail)s">%(name)s</a>""" % fmt
-
 def format_filemode(filetype, filemode):
        if filetype == 2:
                prefix = "l"
index 8094e52245069fea4e56378b3fdd907a412133b5..9d064f715afa8f51b9cb6d0fe5ce7126f68ef890 100644 (file)
@@ -8,7 +8,7 @@
                <dd class="muted">
                        {{ bug.status }} {% if bug.resolution %}{{ bug.resolution }}{% end %}
                        {% if bug.assignee %}
-                               &dash; {% raw format_email(bug.assignee) %}
+                               &dash; {% module LinkToUser(bug.assignee) %}
                        {% end %}
                </dd>
        {% end %}
index 38f1915b13b0886e9f230643747bca6e30bb7015..99c7bc1f904f1baed167e683996394e4b67a7dce 100644 (file)
@@ -25,7 +25,7 @@
                                        {{ format_date(commit.date, full_format=True) }}
                                </td>
                                <td>
-                                       {% raw format_email(commit.author) %}
+                                       {% module LinkToUser(commit.author) %}
                                </td>
                                <td>
                                        {{ commit.subject }}
index 8a4b46e24c72a27c7cc6a910943305285c393e1d..77541961f35c534c111a73a8a5cb33fdb0df1a09 100644 (file)
@@ -79,7 +79,6 @@ class BaseHandler(tornado.web.RequestHandler):
                        "format_date"     : self.format_date,
                        "format_size"     : misc.format_size,
                        "friendly_time"   : misc.friendly_time,
-                       "format_email"    : misc.format_email,
                        "format_filemode" : misc.format_filemode,
                        "lang"            : self.locale.code[:2],
                        "session"         : self.session,
@@ -107,4 +106,4 @@ class BaseHandler(tornado.web.RequestHandler):
                        tb = None
 
                self.render(error_document, status_code=status_code,
-                       status_message=status_message, exc_info=exc_info, tb=tb, **kwargs)
\ No newline at end of file
+                       status_message=status_message, exc_info=exc_info, tb=tb, **kwargs)