Don't do 'x == a or x == b'. Prefer 'x in [a, b]' instead.
Signed-off-by: Stephen Finucane <stephenfinucane@hotmail.com>
Reviewed-by: Daniel Axtens <dja@axtens.net>
if not user.is_authenticated():
return False
- if self.submitter.user == user or self.delegate == user:
+ if user in [self.submitter.user, self.delegate]:
return True
return self.project.is_editable(user)
state = 0
commentbuf += buf + line
buf = ''
- elif state == 4 or state == 5:
+ elif state in [4, 5]:
if line.startswith('-'):
lc[0] -= 1
elif line.startswith('+'):
return ['no such bundle']
for patch in patches:
- if action == 'create' or action == 'add':
+ if action in ['create', 'add']:
bundlepatch_count = BundlePatch.objects.filter(bundle=bundle,
patch=patch).count()
if bundlepatch_count == 0: