Skip to content

Commit

Permalink
Simplify DEBUG check in startup event (#1362)
Browse files Browse the repository at this point in the history
* Simplify DEBUG check in startup event

* Corrected Discord webhook validation
  • Loading branch information
Atomic8oy authored Oct 13, 2024
1 parent 23bd92f commit b1be3b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/dashboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def run_build():

@app.on_event("startup")
def startup():
if DEBUG is True:
if DEBUG:
run_dev()
else:
run_build()
4 changes: 2 additions & 2 deletions cli/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def validate_telegram_id(value: Union[int, str]) -> Union[int, None]:
def validate_discord_webhook(value: str) -> Union[str, None]:
if not value or value == "0":
return ""
if not value.startswith("https://discord.com"):
utils.error("Discord webhook must start with 'https://discord.com'")
if not value.startswith("https://discord.com/api/webhooks/"):
utils.error("Discord webhook must start with 'https://discord.com/api/webhooks/'")
return value


Expand Down

0 comments on commit b1be3b0

Please sign in to comment.