Adjust user model.

This commit is contained in:
Edward Betts 2019-09-29 19:01:18 +01:00
parent 1ca46d0bf2
commit 9acbefc105

View file

@ -58,6 +58,9 @@ class Edit(Base):
depicts = relationship('DepictsItem')
@property
def user_page_url(self):
start = 'https://www.wikidata.org/wiki/User:'
return start + quote(self.username.replace(' ', '_'))
def url_norm_username(self):
return quote(self.username.replace(' ', '_'))
@property
def user_wikidata_url(self):
return 'https://www.wikidata.org/wiki/User:' + self.url_norm_username