mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +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):
|
||||
"""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):
|
||||
"""Enable/disable a service and set messages."""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user