From 857f6a17b7300a3db9af17f9642c1cd3136ad546 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 15 2017 15:18:43 +0000 Subject: fixup: Simplify checking if the priority is in the list of allowed priorities when creating issue --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 6f7ae2f..7e96b36 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -1450,7 +1450,9 @@ def new_issue(session, repo, title, content, user, ticketfolder, issue_id=None, priority = int(priority) except (ValueError, TypeError): priority = None - if priority is not None and str(priority) not in priorities: + if priorities \ + and priority is not None \ + and str(priority) not in priorities: raise pagure.exceptions.PagureException( 'You are trying to create an issue with a priority that does ' 'not exist in the project.')