forked from MarseyWorld/MarseyWorld
remove SITE url from badge urls to make them relative in the event of a future domain change
parent
9fe0bcfc58
commit
bf72234873
|
@ -546,9 +546,11 @@ def badge_grant_post(v):
|
||||||
if desc: new_badge.description = desc
|
if desc: new_badge.description = desc
|
||||||
|
|
||||||
url = request.values.get("url")
|
url = request.values.get("url")
|
||||||
if '\\' in url: abort(400)
|
if url:
|
||||||
|
if '\\' in url: abort(400)
|
||||||
if url: new_badge.url = url
|
if url.startswith(SITE_FULL):
|
||||||
|
url = url.split(SITE_FULL, 1)[1]
|
||||||
|
new_badge.url = url
|
||||||
|
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
Loading…
Reference in New Issue