Restrict the activities that we display on the alerts page's filters to just ones that can actually be in alerts #147

This commit is contained in:
Ian Renton
2026-09-18 21:20:42 +01:00
parent 54d779f036
commit a24e03028b
5 changed files with 70 additions and 34 deletions
+15
View File
@@ -12,6 +12,7 @@ ACTIVITIES: dict[ActivityName, Activity] = {
# any spots with "contest" in the comment will get allocated to this activity.
comment_names=["CONTEST"],
icon="fa-trophy",
alerts_possible=True,
),
ActivityName.DXPEDITION: Activity(
name=ActivityName.DXPEDITION,
@@ -23,6 +24,7 @@ ACTIVITIES: dict[ActivityName, Activity] = {
# this activity to a spot other ways.
comment_names=[],
icon="fa-book-atlas",
alerts_possible=True,
),
ActivityName.SATELLITE: Activity(
name=ActivityName.SATELLITE,
@@ -32,6 +34,7 @@ ACTIVITIES: dict[ActivityName, Activity] = {
refs_globally_unique=False,
comment_names=[],
icon="fa-satellite",
alerts_possible=True,
),
ActivityName.EME: Activity(
name=ActivityName.EME,
@@ -70,6 +73,7 @@ ACTIVITIES: dict[ActivityName, Activity] = {
refs_globally_unique=False,
comment_names=["QRP"],
icon="fa-volume-low",
alerts_possible=True,
),
ActivityName.POTA: Activity(
name=ActivityName.POTA,
@@ -81,6 +85,7 @@ ACTIVITIES: dict[ActivityName, Activity] = {
ref_regex=r"[A-Z]{2}\-\d{4,5}|K\-TEST",
comment_names=["POTA"],
icon="fa-tree",
alerts_possible=True,
),
ActivityName.SOTA: Activity(
name=ActivityName.SOTA,
@@ -92,6 +97,7 @@ ACTIVITIES: dict[ActivityName, Activity] = {
ref_regex=r"[A-Z0-9]{1,3}\/[A-Z]{2}\-\d{3}",
comment_names=["SOTA"],
icon="fa-mountain-sun",
alerts_possible=True,
),
ActivityName.WWFF: Activity(
name=ActivityName.WWFF,
@@ -103,6 +109,7 @@ ACTIVITIES: dict[ActivityName, Activity] = {
ref_regex=r"[A-Z0-9]{1,3}FF\-\d{4}",
comment_names=["WWFF"],
icon="fa-seedling",
alerts_possible=True,
),
ActivityName.GMA: Activity(
name=ActivityName.GMA,
@@ -136,6 +143,7 @@ ACTIVITIES: dict[ActivityName, Activity] = {
ref_regex=r"[A-Z0-9]{1,3}\/[A-Z]{3}\-\d{3}",
comment_names=["HEMA"],
icon="fa-mound",
alerts_possible=True,
),
ActivityName.IOTA: Activity(
name=ActivityName.IOTA,
@@ -202,6 +210,7 @@ ACTIVITIES: dict[ActivityName, Activity] = {
ref_regex=r"[A-Z]{2}\-[A-Z]{3}\d",
comment_names=["SIOTA"],
icon="fa-wheat-awn",
alerts_possible=True,
),
ActivityName.WCA: Activity(
name=ActivityName.WCA,
@@ -225,6 +234,7 @@ ACTIVITIES: dict[ActivityName, Activity] = {
comment_names=["ZLOTA"],
icon="fa-kiwi-bird",
region_flag="🇳🇿",
alerts_possible=True,
),
ActivityName.WOTA: Activity(
name=ActivityName.WOTA,
@@ -237,6 +247,7 @@ ACTIVITIES: dict[ActivityName, Activity] = {
comment_names=["WOTA"],
icon="fa-w",
region_flag="🇬🇧",
alerts_possible=True,
),
ActivityName.BOTA: Activity(
name=ActivityName.BOTA,
@@ -247,6 +258,7 @@ ACTIVITIES: dict[ActivityName, Activity] = {
ref_type=ActivityRefType.BEACH,
comment_names=[],
icon="fa-umbrella-beach",
alerts_possible=True,
),
ActivityName.KRMNPA: Activity(
name=ActivityName.KRMNPA,
@@ -259,6 +271,7 @@ ACTIVITIES: dict[ActivityName, Activity] = {
comment_names=["KRMNPA"],
icon="fa-earth-oceania",
region_flag="🇦🇺",
alerts_possible=True,
),
ActivityName.SANPCPA: Activity(
name=ActivityName.SANPCPA,
@@ -271,6 +284,7 @@ ACTIVITIES: dict[ActivityName, Activity] = {
comment_names=["SANPCPA"],
icon="fa-earth-oceania",
region_flag="🇦🇺",
alerts_possible=True,
),
ActivityName.LLOTA: Activity(
name=ActivityName.LLOTA,
@@ -282,6 +296,7 @@ ACTIVITIES: dict[ActivityName, Activity] = {
ref_regex=r"LL[A-Z]{2}\-\d{4}",
comment_names=["LLOTA"],
icon="fa-water",
alerts_possible=True,
),
ActivityName.TOWERS: Activity(
name=ActivityName.TOWERS,
+4
View File
@@ -43,3 +43,7 @@ class Activity:
# Emoji flag for the country or region where this activity is relevant, if any. If None, this implies the
# activity is in worldwide usage.
region_flag: str | None = None
# Can alerts ever have this activity? A lot of activities can be figured out from spot comments but can never
# occur in alerts, so to avoid showing all activities on the "upcoming" page, we allow it to filter based on
# this.
alerts_possible: bool = False