Regenerate event CSS on plugins change

This commit is contained in:
Raphael Michel
2019-09-04 15:39:23 +02:00
parent f7a356c340
commit d6985123b4
2 changed files with 7 additions and 1 deletions

View File

@@ -826,18 +826,24 @@ class Event(EventMixin, LoggedModel):
def enable_plugin(self, module, allow_restricted=False):
plugins_active = self.get_plugins()
from pretix.presale.style import regenerate_css
if module not in plugins_active:
plugins_active.append(module)
self.set_active_plugins(plugins_active, allow_restricted=allow_restricted)
regenerate_css.apply_async(args=(self.pk,))
def disable_plugin(self, module):
plugins_active = self.get_plugins()
from pretix.presale.style import regenerate_css
if module in plugins_active:
plugins_active.remove(module)
self.set_active_plugins(plugins_active)
regenerate_css.apply_async(args=(self.pk,))
@staticmethod
def clean_has_subevents(event, has_subevents):
if event is not None and event.has_subevents is not None:

View File

@@ -20,7 +20,7 @@ from pretix.multidomain.urlreverse import get_domain
from pretix.presale.signals import sass_postamble, sass_preamble
logger = logging.getLogger('pretix.presale.style')
affected_keys = ['primary_font', 'primary_color']
affected_keys = ['primary_font', 'primary_color', 'theme_color_success', 'theme_color_danger']
def compile_scss(object, file="main.scss", fonts=True):