fix 500 error on badge geant

pull/83/head
Aevann 2023-01-01 04:36:04 +02:00
parent b7dbe998f9
commit e2bd765b62
1 changed files with 2 additions and 2 deletions

View File

@ -8,10 +8,10 @@ def badge_grant(user, badge_id, description=None, url=None, notify=True):
if user.has_badge(badge_id):
return
if len(description) > 256:
if description and len(description) > 256:
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!")
badge = Badge(