[yocto] [layerindex-web][PATCH 3/6] Fix error on publish if no non-root superuser/staff accounts exist

Paul Eggleton paul.eggleton at linux.intel.com
Mon Jan 8 20:20:26 PST 2018


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 <paul.eggleton at linux.intel.com>
---
 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
-- 
2.9.5




More information about the yocto mailing list