Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency ubuntu to v22 #73

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:12
Expand Down
653 changes: 4 additions & 649 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ help:
@echo " make celery-worker-start -- starts the celery worker in the foreground"
@echo " make celery-worker-status -- lists all registered tasks and active worker nodes"
@echo " make celery-worker-dummy-task -- calls the dummy task and prints result from redis"
@echo " make saml-install -- script to install local version of single sign-in in docker container"
@echo " make saml-server -- script to run local version of single sign-in in docker container"
@echo

.PHONY: install
Expand Down
Binary file modified adhocracy-plus/assets/images/email_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added adhocracy-plus/assets/images/logo_sharepic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions adhocracy-plus/assets/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $brand-tertiary: #73add5 !default; // lighter blue

/* Don't use variables but hex-values here as they should not be overwritten on organisation pages */
$brand-success: #d7e4ac !default;
$brand-info: $brand-secondary !default; // $brand-primary from platform.scss
$brand-info: $brand-primary !default; // $brand-primary from platform.scss
$brand-warning: #f9d2a6 !default;
$brand-danger: #e9aab3 !default;

Expand Down Expand Up @@ -43,7 +43,7 @@ $print-link: #005cb4 !default;

$brand-primary-tint: lighten($brand-primary, 47%) !default;
$brand-secondary-tint: lighten($brand-secondary, 20%) !default;
$brand-tertiary-tint: lighten($brand-tertiary, 55%) !default;
$brand-tertiary-tint: lighten($brand-tertiary, 30%) !default;

$bg-tertiary: #d9e9f4 !default;
$bg-secondary: #c1d9e1 !default;
Expand Down
2 changes: 1 addition & 1 deletion adhocracy-plus/assets/scss/components/_alerts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $messages-margin-bottom: 25px;
.alert {
margin: 0;
padding: (1.2 * $padding) $padding;
background-color: $brand-info;
background-color: lighten($brand-info, 30%);
color: $text-color;
text-align: center;
border-radius: 0;
Expand Down
4 changes: 2 additions & 2 deletions adhocracy-plus/assets/scss/components/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
}

.btn.btn--light {
@include button($brand-tertiary, $text-color, $text-color, 57%);
@include button($brand-tertiary, $text-color, $text-color, 30%);
}

.btn.btn--primary {
Expand All @@ -77,7 +77,7 @@
}

.btn.btn--secondary-filled {
@include button-bg($brand-secondary, $brand-secondary, $print-black, 10%);
@include button-bg($brand-secondary, $brand-secondary, $print-black, 3%);
}

.btn.btn--bg-tertiary {
Expand Down
4 changes: 2 additions & 2 deletions adhocracy-plus/assets/scss/components/_poll.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ $checkbox-size: 20px;
}

.poll-row__bar {
background-color: $brand-primary-tint;
background-color: $brand-tertiary-tint;
position: absolute;
top: 0;
bottom: 0;
Expand All @@ -102,7 +102,7 @@ $checkbox-size: 20px;
}

.poll__highlight {
background-color: $brand-tertiary-tint;
background-color: $brand-primary-tint;
}

.poll__btn--wrapper {
Expand Down
77 changes: 37 additions & 40 deletions adhocracy-plus/config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,30 @@
# Application definition

INSTALLED_APPS = (

'django.contrib.sites',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sitemaps',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'apps.djangosaml2_overwrites',
'djangosaml2',

'widget_tweaks',
'rest_framework',
'rest_framework.authtoken',
'django_filters',
'allauth',
'allauth.account',
'allauth.socialaccount',
'rules.apps.AutodiscoverRulesConfig',
'easy_thumbnails',
'ckeditor',
'ckeditor_uploader',
'background_task',
'parler',

"django.contrib.sites",
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.sitemaps",
"django.contrib.messages",
"django.contrib.staticfiles",
"django.contrib.humanize",
"apps.djangosaml2_overwrites",
"djangosaml2",
"widget_tweaks",
"rest_framework",
"rest_framework.authtoken",
"django_filters",
"allauth",
"allauth.account",
"allauth.socialaccount",
"rules.apps.AutodiscoverRulesConfig",
"easy_thumbnails",
"ckeditor",
"ckeditor_uploader",
"background_task",
"parler",
# Wagtail cms components
"wagtail.contrib.forms",
"wagtail.contrib.redirects",
Expand Down Expand Up @@ -128,22 +125,20 @@
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.locale.LocaleMiddleware",
"django.middleware.common.CommonMiddleware",
'djangosaml2.middleware.SamlSessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',

'wagtail.contrib.redirects.middleware.RedirectMiddleware',
'apps.djangosaml2_overwrites.middlewares.SamlSignupMiddleware',
"djangosaml2.middleware.SamlSessionMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"wagtail.contrib.redirects.middleware.RedirectMiddleware",
"apps.djangosaml2_overwrites.middlewares.SamlSignupMiddleware",
)

ROOT_URLCONF = "adhocracy-plus.config.urls"

LOCALE_PATHS = [
# use the first line in branches and forks to keep the original translations
# from main branch and overwrite or add extra translations in fork

os.path.join(BASE_DIR, 'locale-fork/locale'),
os.path.join(BASE_DIR, 'locale-source/locale')
os.path.join(BASE_DIR, "locale-fork/locale"),
os.path.join(BASE_DIR, "locale-source/locale"),
]

TEMPLATES = [
Expand Down Expand Up @@ -276,10 +271,10 @@
AUTH_USER_MODEL = "a4_candy_users.User"

AUTHENTICATION_BACKENDS = (
'rules.permissions.ObjectPermissionBackend',
'django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend',
'djangosaml2.backends.Saml2Backend',
"rules.permissions.ObjectPermissionBackend",
"django.contrib.auth.backends.ModelBackend",
"allauth.account.auth_backends.AuthenticationBackend",
"djangosaml2.backends.Saml2Backend",
)

ACCOUNT_ADAPTER = "apps.users.adapters.AccountAdapter"
Expand Down Expand Up @@ -571,3 +566,5 @@
CELERY_RESULT_BACKEND = "redis://localhost:6379"
CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP = True
CELERY_RESULT_EXTENDED = True

USER_REGISTRATION = False
3 changes: 3 additions & 0 deletions adhocracy-plus/templates/account/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ <h1>{% translate "Login" %}</h1>

{% include "account/diid/saml2.html" with process="login" %}

{% if usersignup %}

<h4>{% trans "You don't have a HHU account?" context "diid" %}</h4>

<p>{% blocktranslate %}If you have not created an account yet, then please <a href="{{ signup_url }}">register</a> first.{% endblocktranslate %}</p>
Expand Down Expand Up @@ -37,4 +39,5 @@ <h4>{% trans "You don't have a HHU account?" context "diid" %}</h4>
</form>

{% include "socialaccount/snippets/provider_list.html" with process="login" %}
{% endif %}
{% endblock %}
2 changes: 2 additions & 0 deletions adhocracy-plus/templates/account/password_change.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{% block title %}{% translate "Change password" %} &mdash; {{ block.super }}{% endblock %}

{% block dashboard_content %}
{% if usersignup %}
<h1 class="mt-0">{% translate 'Change your password' %}</h1>

<form name="PasswordChangeForm" action="{% url 'account_change_password' %}" method="post">
Expand Down Expand Up @@ -40,4 +41,5 @@ <h1 class="mt-0">{% translate 'Change your password' %}</h1>
<button type="submit" value="reset" class="btn btn--primary">{% translate "Change password" %}</button>
</div>
</form>
{% endif %}
{% endblock %}
3 changes: 3 additions & 0 deletions adhocracy-plus/templates/account/password_reset.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{% extends "account/base.html" %}

{% load i18n account %}

{% block head_title %}{% translate "Password Reset" %}{% endblock %}

{% block content %}
{% if usersignup %}
<h1>{% translate "Password Reset" %}</h1>
{% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %}
Expand All @@ -19,4 +21,5 @@ <h1>{% translate "Password Reset" %}</h1>
</form>
<p>{% blocktranslate %}Please contact us if you have any trouble resetting your password.{% endblocktranslate %}</p>

{% endif %}
{% endblock %}
3 changes: 3 additions & 0 deletions adhocracy-plus/templates/account/password_reset_from_key.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{% extends "account/base.html" %}

{% load i18n %}

{% block head_title %}{% translate "Change Password" %}{% endblock %}

{% block content %}
{% if usersignup %}
<h1>{% if token_fail %}{% translate "Bad Token" %}{% else %}{% translate "Change Password" %}{% endif %}</h1>

{% if token_fail %}
Expand All @@ -23,4 +25,5 @@ <h1>{% if token_fail %}{% translate "Bad Token" %}{% else %}{% translate "Change
<p>{% translate 'Your password is now changed.' %}</p>
{% endif %}
{% endif %}
{% endif %}
{% endblock %}
12 changes: 11 additions & 1 deletion adhocracy-plus/templates/account/signup.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{% extends "account/base.html" %}

{% load i18n %}

{% block head_title %}{% translate "Register" %}{% endblock %}

{% block content %}
{% if usersignup %}
<h1>{% translate "Register" %}</h1>

<p>{% blocktranslate %}Already have an account? Then please
Expand All @@ -22,7 +24,14 @@ <h1>{% translate "Register" %}</h1>
<label class="form-check__label">
{{ form.data_protection }}
{% blocktrans with data_protection_policy=settings.a4_candy_cms_settings.ImportantPages.data_protection_policy.url context "diid" %}
I hereby voluntarily agree that my data and in particular my contributions to the participation platform dialog.diid.hhu.de are collected, processed and published in accordance with sections 2.3 & 2.4 of the <a href="{{data_protection_policy}}" target="_blank">data protection policy</a>. My consent also expressly refers to the processing of special categories of personal data within the meaning of Art. 9 DSGVO, if I have mentioned these in my own contributions. I am aware that the consents are voluntary and can be refused without any disadvantages (even individually) or revoked at any time without giving reasons. I am aware that in the event of revocation, the legality of the processing carried out on the basis of the consent until revocation is not affected. I understand that I can simply contact the contact person named in the data protection policy for a revocation. I have been informed of the <a href="{{data_protection_policy}}" target="_blank">data protection policy</a> for dialog.diid.hhu.de and made available.
I hereby voluntarily consent to my data and in particular my contributions to the participation platform dialog.diid.hhu.de being
collected, processed, evaluated, published and, if necessary, passed on anonymously to third parties for research purposes in
accordance with the <a href="{{data_protection_policy}}" target="_blank">data protection policy</a>. My consent also explicitly refers to the
processing of special categories of personal data within the meaning of Art. 9 DSGVO if I have mentioned these in my own contributions.
I am aware that the consents are voluntary and can be refused without disadvantages (also individually) or revoked at any time without
giving reasons. I know that in the event of a revocation, the lawfulness of the processing carried out on the basis of the consent until
the revocation is not affected. I understand that for a revocation I can simply contact the contact person named in the
<a href="{{data_protection_policy}}" target="_blank">data protection policy</a>.
{% endblocktrans %}
{% if form.data_protection.field.required %}<span role="presentation" title="{% trans 'This field is required' %}">*</span>{% endif %}
</label>
Expand Down Expand Up @@ -91,4 +100,5 @@ <h1>{% translate "Register" %}</h1>
</form>

{% include "socialaccount/snippets/provider_list.html" with process="login" %}
{% endif %}
{% endblock %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% extends "a4_candy_contrib/includes/form_field.html" %}
{% load i18n %}

{% block after_label %}
<p>{% translate 'Your username will appear publicly next to your contributions. <b>We ask you to state your full name and your full academic degree (Prof. Dr. or Dr.).</b> This is relevant for the evaluation of the participation project.' %}</p>
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,21 @@ <h1>{% trans "Sign Up" %}</h1>
{% endfor %}

<div class="form-group">
{% include 'a4_candy_contrib/includes/form_field.html' with field=form.username %}
{% include 'djangosaml2_overwrites/includes/form_field.html' with field=form.username %}
</div>

<div class="form-check">
<label class="form-check__label">
{{ form.data_protection }}
{% blocktrans with data_protection_policy=settings.a4_candy_cms_settings.ImportantPages.data_protection_policy.url context "diid" %}
I hereby voluntarily agree that my data and in particular my contributions to the participation platform dialog.diid.hhu.de are collected, processed and published in accordance with sections 2.3 & 2.4 of the <a href="{{data_protection_policy}}" target="_blank">data protection policy</a>. My consent also expressly refers to the processing of special categories of personal data within the meaning of Art. 9 DSGVO, if I have mentioned these in my own contributions. I am aware that the consents are voluntary and can be refused without any disadvantages (even individually) or revoked at any time without giving reasons. I am aware that in the event of revocation, the legality of the processing carried out on the basis of the consent until revocation is not affected. I understand that I can simply contact the contact person named in the data protection policy for a revocation. I have been informed of the <a href="{{data_protection_policy}}" target="_blank">data protection policy</a> for dialog.diid.hhu.de and made available.
I hereby voluntarily consent to my data and in particular my contributions to the participation platform dialog.diid.hhu.de being
collected, processed, evaluated, published and, if necessary, passed on anonymously to third parties for research purposes in
accordance with the <a href="{{data_protection_policy}}" target="_blank">data protection policy</a>. My consent also explicitly refers to the
processing of special categories of personal data within the meaning of Art. 9 DSGVO if I have mentioned these in my own contributions.
I am aware that the consents are voluntary and can be refused without disadvantages (also individually) or revoked at any time without
giving reasons. I know that in the event of a revocation, the lawfulness of the processing carried out on the basis of the consent until
the revocation is not affected. I understand that for a revocation I can simply contact the contact person named in the
<a href="{{data_protection_policy}}" target="_blank">data protection policy</a>.
{% endblocktrans %}
{% if form.data_protection.field.required %}<span role="presentation" title="{% trans 'This field is required' %}">*</span>{% endif %}
</label>
Expand Down
4 changes: 3 additions & 1 deletion apps/organisations/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,9 @@ def generate_image(self, data):
if data["add_aplus_logo"]:
# get aplus logo
logo_aplus_get = Image.open(
os.path.join(settings.BASE_DIR, "adhocracy-plus/assets/images/logo.png")
os.path.join(
settings.BASE_DIR, "adhocracy-plus/assets/images/logo_sharepic.png"
)
)
logo_aplus_size = (
sharepic_format["aplus_logo_width"],
Expand Down
21 changes: 21 additions & 0 deletions apps/users/migrations/0007_alter_user_get_notifications.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 3.2.19 on 2023-10-12 08:33

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("a4_candy_users", "0006_change_error_wording_email_address"),
]

operations = [
migrations.AlterField(
model_name="user",
name="get_notifications",
field=models.BooleanField(
default=False,
help_text="Designates whether you want to receive notifications. Select if you want to receive notifications.",
verbose_name="Send me email notifications",
),
),
]
4 changes: 2 additions & 2 deletions apps/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ class User(auth_models.AbstractBaseUser, auth_models.PermissionsMixin):

get_notifications = models.BooleanField(
verbose_name=_("Send me email notifications"),
default=True,
default=False,
help_text=_(
"Designates whether you want to receive notifications. "
"Unselect if you do not want to receive notifications."
"Select if you want to receive notifications."
),
)

Expand Down
9 changes: 9 additions & 0 deletions apps/users/templatetags/usersignup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django import template
from django.conf import settings

register = template.Library()


@register.simple_tag
def usersignup():
return getattr(settings, "USER_REGISTRATION", "")
Loading
Loading