From cd65c0471915c28dd95c15b4b5b1b42ab47d2e4f Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 11 Mar 2020 15:40:04 -0700 Subject: [PATCH] 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 Reviewed-by: Veiko Aasa --- plinth/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plinth/views.py b/plinth/views.py index d13b97b70..fb6c3ccdd 100644 --- a/plinth/views.py +++ b/plinth/views.py @@ -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."""