diff --git a/plinth/modules/upgrades/__init__.py b/plinth/modules/upgrades/__init__.py index e0e9ba80a..34bb13dd0 100644 --- a/plinth/modules/upgrades/__init__.py +++ b/plinth/modules/upgrades/__init__.py @@ -27,11 +27,6 @@ first_boot_steps = [ 'url': 'upgrades:backports-firstboot', 'order': 5, }, - { - 'id': 'initial_update', - 'url': 'upgrades:update-firstboot', - 'order': 6, - }, ] _description = [ diff --git a/plinth/modules/upgrades/forms.py b/plinth/modules/upgrades/forms.py index c97688a43..390963512 100644 --- a/plinth/modules/upgrades/forms.py +++ b/plinth/modules/upgrades/forms.py @@ -33,9 +33,3 @@ class BackportsFirstbootForm(forms.Form): backports_enabled = forms.BooleanField( label=_('Activate frequent feature updates (recommended)'), required=False, initial=True) - - -class UpdateFirstbootForm(forms.Form): - """Form to run or skip initial update during first boot wizard.""" - update_now = forms.BooleanField(label=_('Update now (recommended)'), - required=False, initial=True) diff --git a/plinth/modules/upgrades/templates/update-firstboot-progress.html b/plinth/modules/upgrades/templates/update-firstboot-progress.html deleted file mode 100644 index 1082ebc46..000000000 --- a/plinth/modules/upgrades/templates/update-firstboot-progress.html +++ /dev/null @@ -1,42 +0,0 @@ -{% extends "base_firstboot.html" %} -{% comment %} -# SPDX-License-Identifier: AGPL-3.0-or-later -{% endcomment %} - -{% load bootstrap %} -{% load i18n %} -{% load static %} - -{% block content %} -

{% trans "Software Update" %}

- - {% if is_busy %} -
-
- -
-

- {% trans "Updating, please wait..." %} -

-

- {% blocktrans trimmed %} - This may take a long time to complete. During - an update, this web interface may be temporarily unavailable and - show an error. In that case, refresh the page to continue. - {% endblocktrans %} -

-
- {% else %} -

- {% blocktrans %} - {{ box_name }} is up to date. Press Next to continue. - {% endblocktrans %} -

- - {% trans 'Next' %} - - {% endif %} - -{% endblock %} diff --git a/plinth/modules/upgrades/templates/update-firstboot.html b/plinth/modules/upgrades/templates/update-firstboot.html deleted file mode 100644 index 374c6bf95..000000000 --- a/plinth/modules/upgrades/templates/update-firstboot.html +++ /dev/null @@ -1,36 +0,0 @@ -{% extends "base_firstboot.html" %} -{% comment %} -# SPDX-License-Identifier: AGPL-3.0-or-later -{% endcomment %} - -{% load bootstrap %} -{% load i18n %} -{% load static %} - -{% block content %} -

{% trans "Software Update" %}

- -

- {% blocktrans trimmed %} - Check for and apply the latest software and security updates. - {% endblocktrans %} -

- -

- {% blocktrans trimmed %} - This may take a long time to complete. During - an update, this web interface may be temporarily unavailable and - show an error. In that case, refresh the page to continue. - {% endblocktrans %} -

- -
- {% csrf_token %} - - {{ form|bootstrap }} - - -
- -{% endblock %} diff --git a/plinth/modules/upgrades/urls.py b/plinth/modules/upgrades/urls.py index 807ebb328..15955bd91 100644 --- a/plinth/modules/upgrades/urls.py +++ b/plinth/modules/upgrades/urls.py @@ -15,11 +15,6 @@ urlpatterns = [ re_path(r'^sys/upgrades/firstboot/backports/$', views.BackportsFirstbootView.as_view(), name='backports-firstboot'), - re_path(r'^sys/upgrades/firstboot/update/$', - views.UpdateFirstbootView.as_view(), name='update-firstboot'), - re_path(r'^sys/upgrades/firstboot/update/progress/$', - views.UpdateFirstbootProgressView.as_view(), - name='update-firstboot-progress'), re_path(r'^sys/upgrades/upgrade/$', views.upgrade, name='upgrade'), re_path(r'^sys/upgrades/test-dist-upgrade/$', views.test_dist_upgrade, name='test-dist-upgrade'), diff --git a/plinth/modules/upgrades/views.py b/plinth/modules/upgrades/views.py index fc1d919c8..7488827b6 100644 --- a/plinth/modules/upgrades/views.py +++ b/plinth/modules/upgrades/views.py @@ -9,7 +9,6 @@ from django.http import HttpResponseRedirect from django.shortcuts import redirect from django.urls import reverse_lazy from django.utils.translation import gettext as _ -from django.views.generic import TemplateView from django.views.generic.edit import FormView from plinth import __version__ @@ -18,7 +17,7 @@ from plinth.privileged import packages as packages_privileged from plinth.views import AppView, messages_error from . import privileged -from .forms import BackportsFirstbootForm, ConfigureForm, UpdateFirstbootForm +from .forms import BackportsFirstbootForm, ConfigureForm class UpgradesConfigurationView(AppView): @@ -170,47 +169,6 @@ class BackportsFirstbootView(FormView): return super().form_valid(form) -class UpdateFirstbootView(FormView): - """View to run initial update during first boot wizard.""" - - template_name = 'update-firstboot.html' - form_class = UpdateFirstbootForm - - def __init__(self): - """Define instance attribute.""" - self.update = True - - def get_success_url(self): - """Return next firstboot step.""" - if self.update: - return reverse_lazy('upgrades:update-firstboot-progress') - - return reverse_lazy(first_boot.next_step()) - - def form_valid(self, form): - """Run update if selected, and mark step as done.""" - self.update = form.cleaned_data['update_now'] - if self.update: - privileged.run() - - first_boot.mark_step_done('initial_update') - return super().form_valid(form) - - -class UpdateFirstbootProgressView(TemplateView): - """View to show initial update progress.""" - - template_name = 'update-firstboot-progress.html' - - def get_context_data(self, *args, **kwargs): - context = super().get_context_data(*args, **kwargs) - context['is_busy'] = (_is_updating() - or packages_privileged.is_package_manager_busy()) - context['next_step'] = first_boot.next_step() - context['refresh_page_sec'] = 3 if context['is_busy'] else None - return context - - def test_dist_upgrade(request): """Test dist-upgrade from stable to testing.""" if request.method == 'POST': diff --git a/plinth/tests/functional/__init__.py b/plinth/tests/functional/__init__.py index 0eee46ef2..57ed0a91e 100644 --- a/plinth/tests/functional/__init__.py +++ b/plinth/tests/functional/__init__.py @@ -354,10 +354,6 @@ def login_with_account(browser, url, username, password=None): if '/firstboot/backports' in browser.url: submit(browser, element=browser.find_by_name('next')[0]) - if '/firstboot/update' in browser.url: - browser.find_by_id('id_update_now').uncheck() - submit(browser, element=browser.find_by_name('next')[0]) - def logout(browser): """Log out of the FreedomBox interface."""