Skip to content

Commit b6c0d06

Browse files
committed
Fix all flake8 2.1.0 warnings
1 parent f524bc3 commit b6c0d06

File tree

15 files changed

+25
-27
lines changed

15 files changed

+25
-27
lines changed

feincms/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ def ensure_completely_loaded(force=False):
7878
# See Issue #323 on github.
7979
if hasattr(loading, 'cache'):
8080
try:
81-
loading.cache.get_models.cache_clear() # Django 1.7+
81+
loading.cache.get_models.cache_clear() # Django 1.7+
8282
except AttributeError:
83-
loading.cache._get_models_cache.clear() # Django 1.6-
83+
loading.cache._get_models_cache.clear() # Django 1.6-
8484

8585
if hasattr(loading.app_cache_ready, '__call__'):
8686
if loading.app_cache_ready():

feincms/admin/item_editor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def get_fieldsets(self, request, obj=None):
333333
fieldsets = copy.deepcopy(
334334
super(ItemEditor, self).get_fieldsets(request, obj))
335335

336-
if not FEINCMS_CONTENT_FIELDSET_NAME in dict(fieldsets).keys():
336+
if FEINCMS_CONTENT_FIELDSET_NAME not in dict(fieldsets).keys():
337337
fieldsets.append(FEINCMS_CONTENT_FIELDSET)
338338

339339
return fieldsets

feincms/admin/tree_editor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def _toggle_boolean(self, request):
353353

354354
self._collect_editable_booleans()
355355

356-
if not attr in self._ajax_editable_booleans:
356+
if attr not in self._ajax_editable_booleans:
357357
return HttpResponseBadRequest("not a valid attribute %s" % attr)
358358

359359
try:

feincms/content/comments/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ def process(self, request, **kwargs):
8181
# post to the current path and handle it this way .. at least it
8282
# works for now.
8383

84-
#extra = request._feincms_extra_context.get('page_extra_path', ())
85-
#if len(extra) > 0 and extra[0] == "post-comment":
84+
# extra = request._feincms_extra_context.get('page_extra_path', ())
85+
# if len(extra) > 0 and extra[0] == "post-comment":
8686

8787
r = post_comment(request, next=comment_page.get_absolute_url())
8888

feincms/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,8 @@ def _template(self):
412412
cls.template = property(_template)
413413

414414
cls.TEMPLATE_CHOICES = field._choices = [
415-
(template.key, template.title,)
416-
for template in cls._feincms_templates.values()
415+
(template_.key, template_.title,)
416+
for template_ in cls._feincms_templates.values()
417417
]
418418
field.default = field.choices[0][0]
419419

feincms/module/extensions/ct_tracker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def _fetch_content_type_counts(self):
7979

8080
def _translation_map(self):
8181
cls = self.item.__class__
82-
if not cls in _translation_map_cache:
82+
if cls not in _translation_map_cache:
8383
# Prime translation map and cache it in the class. This needs to be
8484
# done late as opposed to at class definition time as not all
8585
# information is ready, especially when we are doing a "syncdb" the

feincms/module/medialibrary/modeladmins.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CategoryAdmin(admin.ModelAdmin):
4242
prepopulated_fields = {'slug': ('title',)}
4343

4444

45-
#-------------------------------------------------------------------------
45+
# ------------------------------------------------------------------------
4646
def assign_category(modeladmin, request, queryset):
4747
class AddCategoryForm(forms.Form):
4848
_selected_action = forms.CharField(widget=forms.MultipleHiddenInput)
@@ -84,7 +84,7 @@ class AddCategoryForm(forms.Form):
8484
assign_category.short_description = _('Add selected media files to category')
8585

8686

87-
#-------------------------------------------------------------------------
87+
# -------------------------------------------------------------------------
8888
def save_as_zipfile(modeladmin, request, queryset):
8989
from .zip import export_zipfile
9090

feincms/module/medialibrary/models.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,5 +267,3 @@ class Meta:
267267

268268
def __str__(self):
269269
return self.caption
270-
271-
#-------------------------------------------------------------------------

feincms/module/mixins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def register_response_processor(cls, fn, key=None):
4444
cls.response_processors = SortedDict()
4545
cls.response_processors[fn if key is None else key] = fn
4646

47-
# Implement admin_urlname templatetag protocol
47+
# TODO Implement admin_urlname templatetag protocol
4848
@property
4949
def app_label(self):
5050
"""

feincms/module/page/extensions/navigation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def children(self, page, **kwargs):
101101
def navigation_extension_choices():
102102
for ext in NavigationExtension.types:
103103
if (issubclass(ext, NavigationExtension)
104-
and not ext is NavigationExtension):
104+
and ext is not NavigationExtension):
105105
yield ('%s.%s' % (ext.__module__, ext.__name__), ext.name)
106106

107107

0 commit comments

Comments
 (0)