Skip to content

Commit

Permalink
Merge pull request #1333 from wiedehopf/main
Browse files Browse the repository at this point in the history
don't fail on messages without signal level
  • Loading branch information
fredclausen authored Dec 8, 2024
2 parents ae4e420 + a86593c commit 2eeba8a
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions rootfs/webapp/acarshub_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,16 +547,17 @@ def add_message(params, message_type, message_from_json, backup=False):
# We'll see if the level is in the database already, and if so, increment the counter
# If not, we'll add it in

found_level = (
session.query(messagesLevel)
.filter(messagesLevel.level == params["level"])
.first()
)
if params["level"] != "":
found_level = (
session.query(messagesLevel)
.filter(messagesLevel.level == params["level"])
.first()
)

if found_level is not None:
found_level.count += 1
else:
session.add(messagesLevel(level=params["level"], count=1))
if found_level is not None:
found_level.count += 1
else:
session.add(messagesLevel(level=params["level"], count=1))

if len(params["text"]) > 0 and alert_terms:
for search_term in alert_terms:
Expand Down

0 comments on commit 2eeba8a

Please sign in to comment.