Merge pull request #1225 from normanjaeckel/Flake8Errors
Fixed flake8 errors.
This commit is contained in:
commit
d0a0a09d7b
@ -70,7 +70,7 @@ class Overview(TemplateView):
|
||||
if minutes < 10:
|
||||
minutes = "%s%s" % (0, minutes)
|
||||
item.duration = "%s:%s" % (hours, minutes)
|
||||
if not start is None:
|
||||
if start is not None:
|
||||
item.tooltip = start + duration
|
||||
|
||||
if start is None:
|
||||
|
@ -221,7 +221,7 @@ class PollUpdateView(PollFormView):
|
||||
|
||||
def get_success_url(self):
|
||||
return_url = ''
|
||||
if not 'apply' in self.request.POST:
|
||||
if 'apply' not in self.request.POST:
|
||||
return_url = reverse('assignment_detail', args=[self.poll.assignment.id])
|
||||
return return_url
|
||||
|
||||
|
@ -29,7 +29,7 @@ class MediafileUpdateForm(CssClassMixin, ModelForm):
|
||||
"""
|
||||
Method to save the form. Here the overwrite is to delete old files.
|
||||
"""
|
||||
if not self.instance.pk is None:
|
||||
if self.instance.pk is not None:
|
||||
old_file = Mediafile.objects.get(pk=self.instance.pk).mediafile
|
||||
if not old_file == self.instance.mediafile:
|
||||
old_file.delete()
|
||||
|
@ -625,11 +625,11 @@ class Category(models.Model):
|
||||
class Meta:
|
||||
ordering = ['prefix']
|
||||
|
||||
## class Comment(models.Model):
|
||||
## motion_version = models.ForeignKey(MotionVersion)
|
||||
## text = models.TextField()
|
||||
## author = PersonField()
|
||||
## creation_time = models.DateTimeField(auto_now=True)
|
||||
# class Comment(models.Model):
|
||||
# motion_version = models.ForeignKey(MotionVersion)
|
||||
# text = models.TextField()
|
||||
# author = PersonField()
|
||||
# creation_time = models.DateTimeField(auto_now=True)
|
||||
|
||||
|
||||
class MotionLog(models.Model):
|
||||
|
@ -183,7 +183,7 @@ class MotionCreateView(MotionEditMixin, CreateView):
|
||||
"""
|
||||
response = super(MotionCreateView, self).form_valid(form)
|
||||
self.object.write_log([ugettext_noop('Motion created')], self.request.user)
|
||||
if (not 'submitter' in form.cleaned_data or
|
||||
if ('submitter' not in form.cleaned_data or
|
||||
not form.cleaned_data['submitter']):
|
||||
self.object.add_submitter(self.request.user)
|
||||
return response
|
||||
|
@ -127,7 +127,7 @@ class GroupForm(forms.ModelForm, CssClassMixin):
|
||||
# TODO: Check this in clean_users or clean_permissions
|
||||
if (self.request and
|
||||
not self.request.user.is_superuser and
|
||||
not self.request.user in self.cleaned_data['users'] and
|
||||
self.request.user not in self.cleaned_data['users'] and
|
||||
not Group.objects.exclude(pk=self.instance.pk).filter(
|
||||
permissions__in=[get_protected_perm()],
|
||||
user__pk=self.request.user.pk).exists()):
|
||||
|
Loading…
Reference in New Issue
Block a user