From d728f563111d8ff4403abc596bd468e94be7e417 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Fri, 22 Dec 2017 13:10:25 +1300 Subject: [PATCH] Fix error on publish if no non-root superuser/staff accounts exist We need to set a default for this variable or you get an UnboundLocalError if no non-root superuser/staff accounts are set up in the database. Signed-off-by: Paul Eggleton --- layerindex/views.py | 1 + 1 file changed, 1 insertion(+) diff --git a/layerindex/views.py b/layerindex/views.py index ccb85b8..5b111a3 100644 --- a/layerindex/views.py +++ b/layerindex/views.py @@ -270,6 +270,7 @@ def publish(request, name): bodytext = get_template('layerindex/publishemail.txt') maintainer_names = [m.name for m in maintainers] # find appropriate help contact + help_contact = None for user in User.objects.all(): if user.username != 'root' and (user.is_staff or user.is_superuser) and user.is_active: help_contact = user