forked from rc/aircox
aircox/views/episode: render selected attribute on option 0
This commit is contained in:
parent
8ecf71b96e
commit
cae5bdc1d8
|
@ -60,6 +60,13 @@ class EpisodeUpdateView(UserPassesTestMixin, VueFormDataMixin, PageUpdateView):
|
|||
form_class = forms.EpisodeForm
|
||||
template_name = "aircox/episode_form.html"
|
||||
|
||||
def get_form_kwargs(self, *args, **kwargs):
|
||||
"""Render selected attribute on option 0."""
|
||||
fk = super().get_form_kwargs(*args, **kwargs)
|
||||
if not fk["instance"].status:
|
||||
fk["initial"]["status"] = "0"
|
||||
return fk
|
||||
|
||||
def can_edit(self, obj):
|
||||
return self.test_func()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user