forked from rDrama/rDrama
fix 500 error on badge geant
parent
b7dbe998f9
commit
e2bd765b62
|
@ -8,10 +8,10 @@ def badge_grant(user, badge_id, description=None, url=None, notify=True):
|
||||||
if user.has_badge(badge_id):
|
if user.has_badge(badge_id):
|
||||||
return
|
return
|
||||||
|
|
||||||
if len(description) > 256:
|
if description and len(description) > 256:
|
||||||
abort(400, "Custom description is too long, max 256 characters!")
|
abort(400, "Custom description is too long, max 256 characters!")
|
||||||
|
|
||||||
if len(url) > 256:
|
if url and len(url) > 256:
|
||||||
abort(400, "URL is too long, max 256 characters!")
|
abort(400, "URL is too long, max 256 characters!")
|
||||||
|
|
||||||
badge = Badge(
|
badge = Badge(
|
||||||
|
|
Loading…
Reference in New Issue