Verified Commit 59b274ee authored by Oliver Falk's avatar Oliver Falk

Merge branch 'devel' into oliver-master-patch-31818

parents 6d7a9be0 a8105306
Pipeline #1939 failed with stage
in 17 minutes and 29 seconds
image: docker.io/ofalk/fedora28-python3
image: docker.io/ofalk/fedora31-python3
before_script:
- virtualenv-3 -p python3 /tmp/.virtualenv
- virtualenv -p python3 /tmp/.virtualenv
- source /tmp/.virtualenv/bin/activate
- pip install Pillow
- pip install -r requirements.txt
......
......@@ -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:
......
......@@ -18,13 +18,13 @@
</div>
<div class="form-group">
<div class="checkbox">
<input type="checkbox" name="not_porn" required id="id_not_porn">
<input type="checkbox" name="not_porn" checked required id="id_not_porn">
<label for="id_not_porn">{% trans 'suitable for all ages (i.e. no offensive content)' %}</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<input type="checkbox" name="can_distribute" required id="id_can_distribute">
<input type="checkbox" name="can_distribute" checked required id="id_can_distribute">
<label for="id_can_distribute">{% trans 'can be freely copied' %}</label>
</div>
</div>
......
......@@ -28,13 +28,13 @@
<div class="form-group">
<div class="checkbox">
<input type="checkbox" name="not_porn" required id="id_not_porn">
<input type="checkbox" name="not_porn" checked required id="id_not_porn">
<label for="id_not_porn"><b>{% trans 'required' %}</b>; {% trans 'suitable for all ages (i.e. no offensive content)' %}</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<input type="checkbox" name="can_distribute" required id="id_can_distribute">
<input type="checkbox" name="can_distribute" checked required id="id_can_distribute">
<label for="id_can_distribute"><b>{% trans 'required' %}</b>; {% trans 'can be freely copied' %}</label>
</div>
</div>
......
......@@ -1225,11 +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='/static/img/mm/80.png',
msg_prefix='Why does this not redirect to the default img?')
expected_url='/gravatarproxy/1b1d0b654430c012e47e350db07c83c5?s=80&default=mm',
status_code=302,
msg_prefix='Why does this not redirect to the gravatarproxy and defaulting to mm?')
# Eventually one should check if the data is the same
def test_avatar_url_inexisting_mail_digest_w_default_mm_gravatarproxy_disabled(self): # pylint: disable=invalid-name
......@@ -1431,13 +1432,12 @@ class Tester(TestCase): # pylint: disable=too-many-public-methods
},
follow=True,
)
self.assertContains(
response,
'The two password fields didn&#39;t match.',
'The two password fields didn',
1,
200,
'Old password as entered incorrectly, site should raise an error'
'Old password was entered incorrectly, site should raise an error'
)
def test_password_change_view_post_wrong_new_password2(self):
......@@ -1456,12 +1456,34 @@ class Tester(TestCase): # pylint: disable=too-many-public-methods
self.assertContains(
response,
'The two password fields didn&#39;t match.',
'The two password fields didn',
1,
200,
'Old password as entered incorrectly, site should raise an error'
)
def test_password_change_view_post_common_password(self):
'''
Test password change view post
'''
self.login()
response = self.client.post(
reverse('password_change'), {
'old_password': self.password,
'new_password1': 'Hallo',
'new_password2': 'Hallo',
},
follow=True,
)
self.assertContains(
response,
'This password is too common.',
1,
200,
'Common password, site should raise an error'
)
def test_profile_must_list_first_and_lastname(self):
'''
Test if profile view correctly lists first -/last name
......
......@@ -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 %}
......@@ -53,19 +53,9 @@
<h2 style="color: #4b77f2;">Privacy Policies</h2>
<h2 style="color: #4b77f2;">3rd Party Privacy Policies</h2>
<P>You may consult this list to find the Privacy Policy for each of the advertising partners of Libravatar.</p>
<p>Third-party ad servers or ad networks uses technologies like cookies, JavaScript, or Web Beacons that are used in their respective advertisements and links that appear on Libravatar, which are sent directly to users' browser. They automatically receive your IP address when this occurs. These technologies are used to measure the effectiveness of their advertising campaigns and/or to personalize the advertising content that you see on websites that you visit.</p>
<p>Note that Libravatar has no access to or control over these cookies that are used by third-party advertisers.</p>
<h2 style="color: #4b77f2;">Third Party Privacy Policies</h2>
<p>Libravatar's Privacy Policy does not apply to other advertisers or websites. Thus, we are advising you to consult the respective Privacy Policies of these third-party ad servers for more detailed information. It may include their practices and instructions about how to opt-out of certain options. You may find a complete list of these Privacy Policies and their links here: Privacy Policy Links.</p>
<p>You can choose to disable cookies through your individual browser options. To know more detailed information about cookie management with specific web browsers, it can be found at the browsers' respective websites. What Are Cookies?</p>
<p>At the moment our service does not use any advertising partners and we do not plan to onboard any in foreseeable future. Should this change, this policy will be adapted and all our users will be informed accordingly about this change.</p>
<h2 style="color: #4b77f2;">Children's Information</h2>
......
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