mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 14:02:24 +01:00
Fix mention linkifying emails
This commit is contained in:
parent
a09f11d110
commit
9cc79d9fa5
@ -98,6 +98,8 @@ class MentionPattern(Pattern):
|
||||
self.config = config
|
||||
|
||||
def handleMatch(self, m):
|
||||
from app.models import User
|
||||
|
||||
label = m.group(2)
|
||||
user = m.group(3)
|
||||
package_name = m.group(4)
|
||||
@ -107,6 +109,9 @@ class MentionPattern(Pattern):
|
||||
el.set("href", url_for("packages.view", author=user, name=package_name))
|
||||
return el
|
||||
else:
|
||||
if User.query.filter_by(username=user).count() == 0:
|
||||
return None
|
||||
|
||||
el = ElementTree.Element("a")
|
||||
el.text = label
|
||||
el.set("href", url_for("users.profile", username=user))
|
||||
|
Loading…
Reference in New Issue
Block a user