upgrades: Display correct backports info for unstable

Backports are not enabled and cannot be activated on unstable.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Add statement that backports may not be necessary]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
James Valleroy 2020-07-21 19:53:51 -04:00
parent 8f4681fd10
commit 2f7b3264d1
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 16 additions and 8 deletions

View File

@ -15,20 +15,27 @@
Frequent feature updates can be activated. Activating them is Frequent feature updates can be activated. Activating them is
recommended. recommended.
{% endblocktrans %} {% endblocktrans %}
{% else %} {% elif is_backports_enabled %}
{% blocktrans trimmed %} {% blocktrans trimmed %}
Frequent feature updates are enabled. Frequent feature updates are enabled.
{% endblocktrans %} {% endblocktrans %}
{% else %}
{% blocktrans trimmed %}
Frequent feature updates cannot be activated. They may not be necessary
on your distribution.
{% endblocktrans %}
{% endif %} {% endif %}
</p> </p>
<p> <p>
{% blocktrans trimmed %} {% if can_activate_backports or is_backports_enabled %}
This will allow a very limited set of software, including FreedomBox {% blocktrans trimmed %}
service, to be updated to receive newer features regularly instead of once This will allow a very limited set of software, including FreedomBox
every 2 years or so. Note that packages with frequent feature updates do service, to be updated to receive newer features regularly instead of
not have support from Debian Security Team. They are instead maintained by once every 2 years or so. Note that packages with frequent feature
contributors to Debian and the FreedomBox community. updates do not have support from Debian Security Team. They are instead
{% endblocktrans %} maintained by contributors to Debian and the FreedomBox community.
{% endblocktrans %}
{% endif %}
</p> </p>
{% if can_activate_backports %} {% if can_activate_backports %}
<div class="alert alert-warning" role="alert"> <div class="alert alert-warning" role="alert">

View File

@ -29,6 +29,7 @@ class UpgradesConfigurationView(AppView):
def get_context_data(self, *args, **kwargs): def get_context_data(self, *args, **kwargs):
context = super().get_context_data(*args, **kwargs) context = super().get_context_data(*args, **kwargs)
context['can_activate_backports'] = upgrades.can_activate_backports() context['can_activate_backports'] = upgrades.can_activate_backports()
context['is_backports_enabled'] = upgrades.is_backports_enabled()
context['is_busy'] = package.is_package_manager_busy() context['is_busy'] = package.is_package_manager_busy()
context['log'] = get_log() context['log'] = get_log()
context['refresh_page_sec'] = 3 if context['is_busy'] else None context['refresh_page_sec'] = 3 if context['is_busy'] else None