mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
views: Allow AppViews to set self.intial
If a derived view simply sets self.initial instead of overriding get_initial(), honor it just like Django's FormView does. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
parent
39b6592e92
commit
cd65c04719
@ -164,7 +164,9 @@ class AppView(FormView):
|
|||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
"""Return the status of the app to fill in the form."""
|
"""Return the status of the app to fill in the form."""
|
||||||
return self._get_common_status()
|
initial = super().get_initial()
|
||||||
|
initial.update(self._get_common_status())
|
||||||
|
return initial
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
"""Enable/disable a service and set messages."""
|
"""Enable/disable a service and set messages."""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user