Commit 5c8af68a authored by Seb's avatar Seb
Browse files

Quick flake8 fixes

parent 05a43571
[flake8]
ignore = E731,W503
max-line-length = 120
exclude = migrations
......@@ -2,12 +2,12 @@ from __future__ import unicode_literals
from django.db import models
from wagtail.core.models import Page
from wagtailvideos.edit_handlers import VideoChooserPanel
class TestPage(Page):
video_field = models.ForeignKey('wagtailvideos.Video', related_name='+', null=True, blank=True, on_delete=models.SET_NULL)
video_field = models.ForeignKey(
'wagtailvideos.Video', related_name='+', null=True, blank=True, on_delete=models.SET_NULL)
content_panels = Page.content_panels + [
VideoChooserPanel('video_field')
......
......@@ -12,5 +12,6 @@ urlpatterns = [
url(r'^admin/', include(wagtailadmin_urls)),
url(r'', include(wagtail_urls)),
# For media serving
url(r'^%s(?P<path>.*)$' % re.escape(settings.MEDIA_URL.lstrip('/')), serve, kwargs={'document_root': settings.MEDIA_ROOT})
url(r'^%s(?P<path>.*)$' % re.escape(
settings.MEDIA_URL.lstrip('/')), serve, kwargs={'document_root': settings.MEDIA_ROOT})
]
......@@ -69,8 +69,7 @@ class RemoteStorage(FileSystemStorage):
else:
# This fun binary flag incantation makes os.open throw an
# OSError if the file already exists before we open it.
flags = (os.O_WRONLY | os.O_CREAT | os.O_EXCL |
getattr(os, 'O_BINARY', 0))
flags = (os.O_WRONLY | os.O_CREAT | os.O_EXCL | getattr(os, 'O_BINARY', 0))
# The current umask value is masked out by os.open!
fd = os.open(full_path, flags, 0o666)
_file = None
......
......@@ -8,7 +8,6 @@ from wagtail.admin.utils import PermissionPolicyChecker, popular_tags_for_model
from wagtail.core.models import Collection
from wagtail.search import index as search_index
from wagtail.utils.pagination import paginate
from wagtailvideos.forms import get_video_form
from wagtailvideos.models import Video
from wagtailvideos.permissions import permission_policy
......@@ -40,8 +39,8 @@ def chooser(request):
q = None
if (
'q' in request.GET or 'p' in request.GET or 'tag' in request.GET or
'collection_id' in request.GET
'q' in request.GET or 'p' in request.GET or 'tag' in request.GET
or 'collection_id' in request.GET
):
# this request is triggered from search, pagination or 'popular tags';
# we will just render the results.html fragment
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment