Le samedi 29 septembre 2018 à 14:34:28+0200, Pierre-Elliott Bécue a écrit : > How about something like this?
This patch works. I'll send a link in private to show you how it renders. -- Pierre-Elliott Bécue GPG: 9AE0 4D98 6400 E3B6 7528 F493 0D44 2664 1949 74E2 It's far easier to fight for one's principles than to live up to them.
diff --git a/deblayout/static/css/debian.css b/deblayout/static/css/debian.css index 04d3484..c60f31c 100644 --- a/deblayout/static/css/debian.css +++ b/deblayout/static/css/debian.css @@ -760,7 +760,8 @@ ul.downlist li:last-child:after { div.tip , div.important , div.warning -, div.note +, div.error +, div.note , div.trans-note { padding:0 2em 0 4em; margin: 1.85em 0 1.85em 0; @@ -768,13 +769,22 @@ div.tip background-position: 0.5em 0.5em; font-size: 0.75em; line-height: 2em; - background-color:#FFFFCB; border:0.15em solid #CCCCA3; } +div.tip +, div.important +, div.warning +, div.note +, div.trans-note { + background-color:#FFFFCB; +} +div.error { + background-color:#FFAFAF; +} div.tip p , div.important p , div.warning p -, div.note p +, div.note p , div.trans-note p { margin: 1em 0 1em 0; } @@ -784,7 +794,8 @@ div.tip { div.important{ background-image: url('Pics/admon-important.png'); } -div.warning { +div.warning +, div.error { background-image: url('Pics/admon-warning.png'); } div.note diff --git a/keyring/models.py b/keyring/models.py index e1ceced..f450fff 100644 --- a/keyring/models.py +++ b/keyring/models.py @@ -63,6 +63,8 @@ class KeyManager(models.Manager): res = requests.get(url) try: res.raise_for_status() + except requests.HTTPError as e: + raise except Exception as e: raise RuntimeError("GET {} failed: {}".format(url, e)) keytext = [] diff --git a/process/views.py b/process/views.py index e27e9ee..7648c8e 100644 --- a/process/views.py +++ b/process/views.py @@ -7,6 +7,7 @@ from django.db import transaction from django import forms, http from django.core.exceptions import PermissionDenied from django.conf import settings +from django.contrib import messages as django_messages from django.urls import reverse, reverse_lazy from collections import OrderedDict from rest_framework import viewsets @@ -414,10 +415,20 @@ class UpdateKeycheck(RequirementMixin, View): key = Key.objects.get_or_download(self.person.fpr) except RuntimeError as e: key = None + + ret_dest = self.requirement.get_absolute_url() if key is not None: - key.update_key() + try: + key.update_key() + except requests.HTTPError as e: + django_messages.add_message( + request, + django_messages.ERROR, + _("The server met an arror: {}".format(e)), + ) + return redirect(ret_dest) key.update_check_sigs() - return redirect(self.requirement.get_absolute_url()) + return redirect(ret_dest) class DownloadStatements(VisitProcessMixin, View):
signature.asc
Description: PGP signature