Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Websites UFRPE
Wagtail Videos
Commits
5c8af68a
Commit
5c8af68a
authored
Jul 04, 2019
by
Seb
Browse files
Quick flake8 fixes
parent
05a43571
Changes
5
Hide whitespace changes
Inline
Side-by-side
.flake8
0 → 100644
View file @
5c8af68a
[flake8]
ignore = E731,W503
max-line-length = 120
exclude = migrations
tests/app/models.py
View file @
5c8af68a
...
...
@@ -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'
)
...
...
tests/app/urls.py
View file @
5c8af68a
...
...
@@ -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
})
]
tests/storage.py
View file @
5c8af68a
...
...
@@ -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
...
...
wagtailvideos/views/chooser.py
View file @
5c8af68a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment