Explorar o código

handle case where highlight_alias_id is not a number

Son NK %!s(int64=4) %!d(string=hai) anos
pai
achega
b09bb42b2d
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      app/dashboard/views/index.py

+ 7 - 1
app/dashboard/views/index.py

@@ -57,7 +57,13 @@ def index():
 
     highlight_alias_id = None
     if request.args.get("highlight_alias_id"):
-        highlight_alias_id = int(request.args.get("highlight_alias_id"))
+        try:
+            highlight_alias_id = int(request.args.get("highlight_alias_id"))
+        except ValueError:
+            LOG.warning(
+                "highlight_alias_id must be a number, received %s",
+                request.args.get("highlight_alias_id"),
+            )
 
     # User generates a new email
     if request.method == "POST":