Skip to content

Commit 67bb544

Browse files
committed
flake8 clean everything
1 parent fa854d7 commit 67bb544

4 files changed

Lines changed: 11 additions & 7 deletions

File tree

feincms/extensions/translations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def user_has_language_set(request):
4949
This is taken later on as an indication that we should not mess with the
5050
site's language settings, after all, the user's decision is what counts.
5151
"""
52-
if (hasattr(request, 'session')
53-
and request.session.get(LANGUAGE_SESSION_KEY) is not None):
52+
if (hasattr(request, 'session') and
53+
request.session.get(LANGUAGE_SESSION_KEY) is not None):
5454
return True
5555
if LANGUAGE_COOKIE_NAME in request.COOKIES:
5656
return True

feincms/module/medialibrary/modeladmins.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ class MediaFileAdmin(ExtensionModelAdmin):
123123
def get_urls(self):
124124
from django.conf.urls import url
125125

126-
urls = super(MediaFileAdmin, self).get_urls()
127126
return [
128127
url(
129128
r'^mediafile-bulk-upload/$',

feincms/module/page/models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
from __future__ import absolute_import, unicode_literals
66

7-
import re
8-
9-
from django.apps import apps
107
from django.core.exceptions import PermissionDenied
118
from django.db import models
129
from django.db.models import Q
@@ -21,7 +18,10 @@
2118
from feincms.module.mixins import ContentModelMixin
2219
from feincms.module.page import processors
2320
from feincms.utils.managers import ActiveAwareContentManagerMixin
24-
from feincms.utils import shorten_string, match_model_string, get_model_instance
21+
from feincms.utils import (
22+
shorten_string, match_model_string, get_model_instance
23+
)
24+
2525

2626
# ------------------------------------------------------------------------
2727
class BasePageManager(ActiveAwareContentManagerMixin, TreeManager):

feincms/utils/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
from feincms import settings
1717

18+
1819
# ------------------------------------------------------------------------
1920
def get_object(path, fail_silently=False):
2021
# Return early if path isn't a string (might already be an callable or
@@ -34,6 +35,7 @@ def get_object(path, fail_silently=False):
3435
if not fail_silently:
3536
raise
3637

38+
3739
# ------------------------------------------------------------------------
3840
def get_model_instance(app_label, model_name, pk):
3941
"""
@@ -56,10 +58,12 @@ def get_model_instance(app_label, model_name, pk):
5658

5759
return None
5860

61+
5962
# ------------------------------------------------------------------------
6063
REDIRECT_TO_RE = re.compile(
6164
r'^(?P<app_label>\w+).(?P<model_name>\w+):(?P<pk>\d+)$')
6265

66+
6367
def match_model_string(s):
6468
"""
6569
Try to parse a string in format "app_label.model_name:pk", as is used
@@ -75,6 +79,7 @@ def match_model_string(s):
7579
matches = match.groupdict()
7680
return (matches['app_label'], matches['model_name'], int(matches['pk']))
7781

82+
7883
# ------------------------------------------------------------------------
7984
def copy_model_instance(obj, exclude=None):
8085
"""

0 commit comments

Comments
 (0)