tidy workaround
This commit is contained in:
parent
1e0891623a
commit
5cdc4202e9
|
@ -169,9 +169,12 @@ class Item(TimeStampedModel):
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_external(cls, url):
|
def from_external(cls, url):
|
||||||
home = url_for('.home', _external=True)
|
home = url_for('.home', _external=True)
|
||||||
m = re_server_url.match(url)
|
if not url.startswith(home):
|
||||||
if not m:
|
username, _, hashid = url[len(home):].partition('/')
|
||||||
return
|
else:
|
||||||
|
m = re_server_url.match(url)
|
||||||
|
if not m:
|
||||||
|
return
|
||||||
username, hashid = m.groups()
|
username, hashid = m.groups()
|
||||||
item_id = doc_hashids.decode(hashid)[0]
|
item_id = doc_hashids.decode(hashid)[0]
|
||||||
q = cls.query.filter(User.username == username, cls.id == item_id)
|
q = cls.query.filter(User.username == username, cls.id == item_id)
|
||||||
|
|
Loading…
Reference in a new issue