Commit cc9be698 authored by Oliver Falk's avatar Oliver Falk

Merge branch 'devel' into 'master'

Fix redir check

See merge request !163
parents a6d8fe23 c5c4b732
Pipeline #1934 failed with stages
in 8 minutes and 7 seconds
......@@ -180,7 +180,7 @@ class Photo(BaseAccountModel):
# Testing? Ideas anyone?
except Exception as exc: # pylint: disable=broad-except
# For debugging only
print('Exception caught: %s' % exc)
print('Exception caught in Photo.save(): %s' % exc)
return False
self.format = file_format(img.format)
if not self.format:
......
......@@ -1225,10 +1225,12 @@ class Tester(TestCase): # pylint: disable=too-many-public-methods
)
)
url = '%s?%s' % (urlobj.path, urlobj.query)
response = self.client.get(url, follow=True)
response = self.client.get(url, follow=False)
self.assertRedirects(
response=response,
expected_url='/gravatarproxy/1b1d0b654430c012e47e350db07c83c5?s=80&default=mm',
status_code=302,
target_status_code=200,
msg_prefix='Why does this not redirect to the gravatarproxy and defaulting to mm?')
# Eventually one should check if the data is the same
......
......@@ -13,7 +13,6 @@ urlpatterns = [ # pylint: disable=invalid-name
path('admin/', admin.site.urls),
path('i18n/', include('django.conf.urls.i18n')),
url('openid/', include('django_openid_auth.urls')),
url('accounts/', include('ivatar.ivataraccount.urls')),
url('tools/', include('ivatar.tools.urls')),
url(
r'avatar/(?P<digest>\w{64})',
......@@ -36,7 +35,21 @@ urlpatterns = [ # pylint: disable=invalid-name
url('privacy/', TemplateView.as_view(template_name='privacy.html'), name='privacy'),
url('contact/', TemplateView.as_view(template_name='contact.html'), name='contact'),
path('talk_to_us/', RedirectView.as_view(url='/contact'), name='talk_to_us'),
url('', TemplateView.as_view(template_name='home.html'), name='home'),
]
MAINTENANCE = False
try:
if settings.MAINTENANCE:
MAINTENANCE = True
except:
pass
if MAINTENANCE:
urlpatterns.append(url('', TemplateView.as_view(template_name='maintenance.html'), name='home'))
urlpatterns.insert(3, url('accounts/', RedirectView.as_view(url='/')))
else:
urlpatterns.append(url('', TemplateView.as_view(template_name='home.html'), name='home'))
urlpatterns.insert(3, url('accounts/', include('ivatar.ivataraccount.urls')))
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
{% extends 'base_home.html' %}
{% load i18n %}
{% load static %}
{% block title %}{% trans 'federated avatar hosting service' %}{% endblock %}
{% block content %}
<div class="hero">
<div class="container">
<header>
<h1 id='app'>{{ site_name }}</h1>
<h2>{% trans 'freeing the web one face at a time' %}</h2>
</header>
</div>
</div>
<section class="content">
<div class="container">
<div class="text-center">
<h2 style="text-transform: capitalize;font-size: 35px;">{% trans 'Maintenance mode' %}</h2>
Libravatar is currently in maintenance mode.<br/>
Avatars are still served, but all write operations may result
in loss of these changes.
</p>
<hr/>
</div>
</div>
</section>
{% endblock %}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment