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,
|
entity_id=guild.vanity_url_code or guild.id,
|
||||||
)
|
)
|
||||||
|
|
||||||
user = await client.get_or_fetch_user(int(entity_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:
|
if user and str(user.id) == entity_id:
|
||||||
return await render_template(
|
return await render_template(
|
||||||
@ -281,7 +284,10 @@ async def ical(entity_id: str):
|
|||||||
|
|
||||||
return calendar.serialize()
|
return calendar.serialize()
|
||||||
|
|
||||||
user = await client.get_or_fetch_user(int(entity_id))
|
try:
|
||||||
|
user = await client.get_or_fetch_user(int(entity_id))
|
||||||
|
except ValueError:
|
||||||
|
return redirect(url_for(".login"))
|
||||||
|
|
||||||
if user:
|
if user:
|
||||||
calendar = Calendar()
|
calendar = Calendar()
|
||||||
|
Loading…
Reference in New Issue
Block a user