diff --git a/ephios/core/forms/events.py b/ephios/core/forms/events.py index 0e966aae1..ab21cd0d7 100644 --- a/ephios/core/forms/events.py +++ b/ephios/core/forms/events.py @@ -7,6 +7,8 @@ from crispy_forms.layout import Field, Layout, Submit from django.contrib.auth import get_user_model from django.contrib.auth.models import Group +from django.core.cache import cache +from django.core.cache.utils import make_template_fragment_key from django.core.exceptions import ValidationError from django.db.models import Q from django.template.loader import render_to_string @@ -201,6 +203,11 @@ class Meta: fields = ["title", "can_grant_qualification", "color"] widgets = {"color": ColorInput()} + def save(self, commit=True): + cache_key = make_template_fragment_key("eventtype_colors") + cache.delete(cache_key) + return super().save(commit) + def clean_color(self): regex = re.compile(r"#[a-fA-F\d]{6}") if not regex.match(self.cleaned_data["color"]): diff --git a/ephios/core/templates/core/event_detail.html b/ephios/core/templates/core/event_detail.html index f5b3c7346..e63bf7be7 100644 --- a/ephios/core/templates/core/event_detail.html +++ b/ephios/core/templates/core/event_detail.html @@ -12,8 +12,8 @@ {% block html_head %} {% endblock %} diff --git a/ephios/core/templates/core/home.html b/ephios/core/templates/core/home.html index 21d41213d..70c9a3c3f 100644 --- a/ephios/core/templates/core/home.html +++ b/ephios/core/templates/core/home.html @@ -50,10 +50,10 @@
{% trans "Events with requested participations" %}
  • {{ shift.event.title }} ({{ shift.get_start_end_time_display }}) -
    - + {% translate "View" %} - {% translate "Disposition" %}