Fix crash in case of vanity code and not found
This commit is contained in:
parent
f49f69cc79
commit
f7779ace60
@ -221,7 +221,10 @@ async def subscribe(entity_id: str):
|
||||
entity_id=guild.vanity_url_code or guild.id,
|
||||
)
|
||||
|
||||
try:
|
||||
user = await client.get_or_fetch_user(int(entity_id))
|
||||
except ValueError:
|
||||
return redirect(url_for(".login"))
|
||||
|
||||
if user and str(user.id) == entity_id:
|
||||
return await render_template(
|
||||
@ -281,7 +284,10 @@ async def ical(entity_id: str):
|
||||
|
||||
return calendar.serialize()
|
||||
|
||||
try:
|
||||
user = await client.get_or_fetch_user(int(entity_id))
|
||||
except ValueError:
|
||||
return redirect(url_for(".login"))
|
||||
|
||||
if user:
|
||||
calendar = Calendar()
|
||||
|
Loading…
Reference in New Issue
Block a user