Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed bad refactoring. `cc_email` could not be initialized.

  • Loading branch information...
commit c5d5db12517b7716230c4d85ac82aceb71ce5c1b 1 parent cd09c85
@mitar mitar authored
Showing with 10 additions and 4 deletions.
  1. +10 −4 componentpermissions/api.py
View
14 componentpermissions/api.py
@@ -73,10 +73,15 @@ def _get_bypass(self, ticket, username):
return True
if self.allow_reporter and ticket['reporter'] == username:
return True
- if self.allow_cc:
- cc_list = [user for user in NotifyEmail.addrsep_re.split(ticket['cc']) if user]
- if username in cc_list:
- return True
+
+ if not self.allow_cc and not self.allow_cc_email:
+ return False
+
+ cc_list = [user for user in NotifyEmail.addrsep_re.split(ticket['cc']) if user]
+
+ if self.allow_cc and username in cc_list:
+ return True
+
if self.allow_cc_email:
email = self._get_email(username)
if email and email in cc_list:
@@ -85,6 +90,7 @@ def _get_bypass(self, ticket, username):
return True
else:
return True
+
return False
def _get_should_check_permissions(self, ticket):
Please sign in to comment.
Something went wrong with that request. Please try again.