Fix CSS generation with an empty color field

This commit is contained in:
Raphael Michel
2017-05-10 15:09:07 +02:00
parent 36215a989a
commit 8c457c057e

View File

@@ -20,10 +20,10 @@ def regenerate_css(event_id: int):
event = Event.objects.select_related('organizer').get(pk=event_id)
sassdir = os.path.join(settings.STATIC_ROOT, 'pretixpresale/scss')
sassrules = [
'$brand-primary: {};'.format(event.settings.get('primary_color')),
'@import "main.scss";',
]
sassrules = []
if event.settings.get('primary_color'):
sassrules.append('$brand-primary: {};'.format(event.settings.get('primary_color')))
sassrules.append('@import "main.scss";')
css = sass.compile(
string="\n".join(sassrules),