upgrades: Show dist of backports to be activated

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2020-07-05 23:05:43 -04:00 committed by Sunil Mohan Adapa
parent 6ac3d85bae
commit 2f1a6dc0f7
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 5 additions and 1 deletions

View File

@ -14,7 +14,7 @@
{% blocktrans trimmed %}
Backports can be activated. This will allow a limited set of software,
including FreedomBox service, to be upgraded to newer versions from
Debian backports repository.
Debian {{ dist }}-backports repository.
{% endblocktrans %}
</p>
<p>

View File

@ -3,6 +3,8 @@
FreedomBox app for upgrades.
"""
import subprocess
from django.contrib import messages
from django.shortcuts import redirect
from django.urls import reverse_lazy
@ -29,6 +31,8 @@ class UpgradesConfigurationView(AppView):
def get_context_data(self, *args, **kwargs):
context = super().get_context_data(*args, **kwargs)
context['can_activate_backports'] = upgrades.can_activate_backports()
context['dist'] = subprocess.check_output(
['lsb_release', '--codename', '--short']).decode().strip()
context['is_busy'] = package.is_package_manager_busy()
context['log'] = get_log()
context['refresh_page_sec'] = 3 if context['is_busy'] else None