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
c2f40628
Commit
c2f40628
authored
Feb 09, 2021
by
Kevin Gutiérrez
Browse files
Fix forms
parent
0430f27f
Changes
1
Hide whitespace changes
Inline
Side-by-side
wagtailvideos/forms.py
View file @
c2f40628
...
@@ -24,7 +24,7 @@ class BaseVideoForm(BaseCollectionMemberForm):
...
@@ -24,7 +24,7 @@ class BaseVideoForm(BaseCollectionMemberForm):
self
.
fields
[
'file'
].
required
=
'file'
not
in
self
.
initial
or
not
self
.
initial
[
'file'
]
self
.
fields
[
'file'
].
required
=
'file'
not
in
self
.
initial
or
not
self
.
initial
[
'file'
]
# Callback to allow us to override the default form field for the
image
file field
# Callback to allow us to override the default form field for the
video
file field
def
formfield_for_dbfield
(
db_field
,
**
kwargs
):
def
formfield_for_dbfield
(
db_field
,
**
kwargs
):
# Check if this is the file field
# Check if this is the file field
if
db_field
.
name
==
'file'
:
if
db_field
.
name
==
'file'
:
...
@@ -75,7 +75,7 @@ class VideoTranscodeAdminForm(forms.Form):
...
@@ -75,7 +75,7 @@ class VideoTranscodeAdminForm(forms.Form):
GroupVideoPermissionFormSet
=
collection_member_permission_formset_factory
(
GroupVideoPermissionFormSet
=
collection_member_permission_formset_factory
(
Video
,
Video
,
[
[
(
'add_video'
,
_
(
"Add"
),
_
(
"Add/edit
image
s you own"
)),
(
'add_video'
,
_
(
"Add"
),
_
(
"Add/edit
video
s you own"
)),
(
'change_video'
,
_
(
"Edit"
),
_
(
"Edit any video"
)),
(
'change_video'
,
_
(
"Edit"
),
_
(
"Edit any video"
)),
],
],
'wagtailvideos/permissions/includes/video_permissions_formset.html'
'wagtailvideos/permissions/includes/video_permissions_formset.html'
...
...
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