Simplifying the "id:" url detection, per Elrond's suggestion.
As pointed out, we didn't need that nested if. This commit sponsored by Paul Kuriakose. Thank you!
This commit is contained in:
parent
697c74c2de
commit
e4e50a2765
@ -130,9 +130,7 @@ def get_user_media_entry(controller):
|
|||||||
# might not be a slug, might be an id, but whatever
|
# might not be a slug, might be an id, but whatever
|
||||||
media_slug = request.matchdict['media']
|
media_slug = request.matchdict['media']
|
||||||
|
|
||||||
if u":" in media_slug:
|
# if it starts with id: it actually isn't a slug, it's an id.
|
||||||
# okay, it's not actually a slug, it's some kind of identifier,
|
|
||||||
# probably id:
|
|
||||||
if media_slug.startswith(u'id:'):
|
if media_slug.startswith(u'id:'):
|
||||||
try:
|
try:
|
||||||
media = MediaEntry.query.filter_by(
|
media = MediaEntry.query.filter_by(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user