upgrades: Use only sources file to determine if backports enabled

Tests:
- Build deb and install in buster image. Manually remove backports
  sources file. Security page does not show backports notice. Updates
  page shows button to activate backports.
- Activate backports from updates page. Success message is shown and
  button to activate backports is removed. Security page shows
  backports notice.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy authored and Sunil Mohan Adapa committed 2020-07-13 14:44:13 -07:00
1 parent 7caed57caf
commit 6b0744c1c7
4 files changed
+15 -20

No files matched your search

@@ -7,12 +7,12 @@
{% load i18n %}
{% block status %}
{% if backports_in_use %}
{% if is_backports_enabled %}
<h3>{% trans "Security Notice" %}</h3>
<p>
{% blocktrans trimmed %}
You are using packages from Debian backports. Please note that these
packages do not have security support from Debian. However, they are
Backports are enabled. Please note that packages from the backports
repository do not have security support from Debian. However, they are
maintained on a best-effort basis by contributors in Debian and
FreedomBox community.
{% endblocktrans %}
+2 -2
View File
@@ -9,7 +9,7 @@ from django.utils.translation import ugettext as _
from plinth import action_utils, actions
from plinth.modules import security
from plinth.modules.upgrades import get_backports_in_use
from plinth.modules.upgrades import is_backports_enabled
from .forms import SecurityForm
@@ -33,7 +33,7 @@ def index(request):
request, 'security.html', {
'app_info': security.app.info,
'form': form,
'backports_in_use': get_backports_in_use(),
'is_backports_enabled': is_backports_enabled(),
})