Skip to content

Commit f07b736

Browse files
committed
OKRS24-235 Fixed 'ongoing' indicator. USA country is not checked by default.
1 parent 569b4e4 commit f07b736

File tree

4 files changed

+5
-21
lines changed

4 files changed

+5
-21
lines changed

src/signals/filters.py

-9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
FormatChoices,
1717
Signal,
1818
TimeTypeChoices,
19-
GeographicScope,
2019
SeverityPyramidRungsChoices,
2120
)
2221

@@ -56,14 +55,6 @@ class SignalFilter(django_filters.FilterSet):
5655
to_date = django_filters.DateFilter(field_name='to_date', lookup_expr='lte')
5756
signal_availability_days = django_filters.NumberFilter(field_name='signal_availability_days', lookup_expr='gte')
5857

59-
def __init__(self, data, *args, **kwargs):
60-
data = data.copy()
61-
try:
62-
data.setdefault('geographic_scope', GeographicScope.objects.get(name='USA').id)
63-
except GeographicScope.DoesNotExist:
64-
logger.warning("Default Geographic Scope was not found in the database. Using an empty list.")
65-
super().__init__(data, *args, **kwargs)
66-
6758
class Meta:
6859
model = Signal
6960
fields: list[str] = [

src/signals/views.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from signals.filters import SignalFilter
1212
from signals.forms import SignalFilterForm
13-
from signals.models import Signal, GeographicScope
13+
from signals.models import Signal
1414
from signals.serializers import SignalSerializer
1515

1616

@@ -82,13 +82,6 @@ def get_context_data(self, **kwargs) -> Dict[str, Any]:
8282

8383
context: Dict[str, Any] = super().get_context_data(**kwargs)
8484
url_params_dict, url_params_str = self.get_url_params()
85-
if not url_params_dict.get("geographic_scope"):
86-
default_geographic_scope = []
87-
try:
88-
default_geographic_scope = [GeographicScope.objects.get(name="USA").id]
89-
except GeographicScope.DoesNotExist:
90-
logger.warning("Default Geographic Scope was not found in the database. Using an empty list.")
91-
url_params_dict["geographic_scope"] = default_geographic_scope
9285
context["url_params_dict"] = url_params_dict
9386
context["form"] = SignalFilterForm(initial=url_params_dict)
9487
context["url_params_str"] = url_params_str

src/templates/signals/signal_detail.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ <h5>Signals with same base</h5>
231231
<td class="clickable-table-cell"
232232
onClick="location.href='{% url 'signal' pk=signal.id %}';">
233233
{% if signal.active == True%}
234-
<i class="bi bi-circle-fill" style="color:green;"></i>
234+
<i class="fas fa-circle" style="color: green;"></i>
235235
{% else %}
236-
<i class="bi bi-circle-fill" style="color:red;"></i>
236+
<i class="fas fa-circle" style="color:red;"></i>
237237
{% endif %}
238238
</td>
239239
<td class="clickable-table-cell"

src/templates/signals/signals.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,9 @@ <h2 class="accordion-header" id="flush-heading_id_signal_availability">
335335
<td class="clickable-table-cell"
336336
onClick="location.href='{% url 'signal' pk=signal.id %}';">
337337
{% if signal.active == True%}
338-
<i class="bi bi-circle-fill" style="color:green;"></i>
338+
<i class="fas fa-circle" style="color:green;"></i>
339339
{% else %}
340-
<i class="bi bi-circle-fill" style="color:red;"></i>
340+
<i class="fas fa-circle" style="color:red;"></i>
341341
{% endif %}
342342
</td>
343343
<td class="clickable-table-cell"

0 commit comments

Comments
 (0)