mirror of
https://git.linux-kernel.at/oliver/ivatar.git
synced 2025-11-11 18:56:23 +00:00
Add error view if digest is to long/short
This commit is contained in:
@@ -20,6 +20,13 @@ urlpatterns = [ # pylint: disable=invalid-name
|
||||
url(
|
||||
r'avatar/(?P<digest>\w{32})',
|
||||
AvatarImageView.as_view(), name='avatar_view'),
|
||||
url(
|
||||
r'avatar/(?P<digest>\w)',
|
||||
TemplateView.as_view(
|
||||
template_name='error.html',
|
||||
extra_context={
|
||||
'errormessage': 'Incorrect digest length',
|
||||
})),
|
||||
url('description/', TemplateView.as_view(template_name='description.html'), name='description'),
|
||||
# The following two are TODO TODO TODO TODO TODO
|
||||
url('run_your_own/', TemplateView.as_view(template_name='run_your_own.html'), name='run_your_own'),
|
||||
|
||||
@@ -8,7 +8,14 @@
|
||||
{% block content %}
|
||||
<h1 class="error">{% trans 'Error!' %}</h1>
|
||||
|
||||
<p>{% block errormessage %}{% trans 'Libravatar has encountered an error.' %}{% endblock errormessage %}</p>
|
||||
<p>{% block errormessage %}
|
||||
{% trans 'Libravatar has encountered an error.' %}
|
||||
{% if errormessage %}
|
||||
<br/>
|
||||
<br/>
|
||||
{% blocktrans %}{{ errormessage }}{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% endblock errormessage %}</p>
|
||||
|
||||
<div style="height:40px"></div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user