mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
email: Workaround an issue with error on finishing uninstall
Showing the uninstall progress page fails during uninstall of email app. Workaround that by handling the errors raised. A better approach is to ensure that the view is not processed when uninstall operation is in progress. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
16cb8ee021
commit
82104ccf84
@ -25,14 +25,22 @@ class EmailAppView(AppView):
|
|||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
"""Add additional context data for rendering the template."""
|
"""Add additional context data for rendering the template."""
|
||||||
context = super().get_context_data(**kwargs)
|
context = super().get_context_data(**kwargs)
|
||||||
context['dns_entries'] = dns.get_entries()
|
try: # Handle error during uninstall of app
|
||||||
|
context['dns_entries'] = dns.get_entries()
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
return context
|
return context
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
"""Return the initial values to populate in the form."""
|
"""Return the initial values to populate in the form."""
|
||||||
initial = super().get_initial()
|
initial = super().get_initial()
|
||||||
domains = privileged.domain.get_domains()
|
try: # Handle error during uninstall of app
|
||||||
initial['primary_domain'] = domains['primary_domain']
|
domains = privileged.domain.get_domains()
|
||||||
|
initial['primary_domain'] = domains['primary_domain']
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
return initial
|
return initial
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user