Skip to content

Commit

Permalink
Merge pull request #558 from DH-IT-Portal-Development/develop
Browse files Browse the repository at this point in the history
Merge dev to acc
  • Loading branch information
tymees authored Oct 24, 2023
2 parents 7d3cfdc + b04fe9b commit a990f3f
Show file tree
Hide file tree
Showing 24 changed files with 1,033 additions and 419 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/check-missing-migrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Check for missing migrations

on:
pull_request:
jobs:
run-check:
runs-on: ubuntu-latest
steps:
- name: Install OS dependencies
run: |
sudo apt-get update
sudo apt-get install libldap2-dev libsasl2-dev libssl-dev gettext poppler-utils poppler-data libpoppler-cpp-dev
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Check for missing migrations
run: |
python manage.py makemigrations --check --dry-run
4 changes: 2 additions & 2 deletions .github/workflows/django-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Django Tests

on:
push:
branches: [ develop, ]
branches: [ develop, acceptation ]
pull_request:
branches: [ develop, master, ]
branches: [ develop, acceptation, master, ]

jobs:
build:
Expand Down
12 changes: 12 additions & 0 deletions fetc/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# A list of constants imported into settings.py
# Separate to make deployment less of a hassle

# Group names
GROUP_SECRETARY = 'Secretaris'
GROUP_PRIMARY_SECRETARY = 'Primaire secretaris'
GROUP_LINGUISTICS_CHAMBER = 'LK'
GROUP_GENERAL_CHAMBER = 'AK'

# Route durations
PREASSESSMENT_ROUTE_WEEKS = 1
SHORT_ROUTE_WEEKS = 2
3 changes: 1 addition & 2 deletions fetc/saml_settings.example.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
'mail': ('email',),
'givenName': ('first_name',),
'uuPrefixedSn': ('last_name',),
# TODO: create an attribute on the user model to store this value
# 'uuLegacyDepartment': (),
'uuLegacyDepartment': ('process_faculties', ),
}

# Controls which mechanism is used to exchange SAML data with the IdP
Expand Down
19 changes: 9 additions & 10 deletions fetc/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""
import os

from django.core.exceptions import ImproperlyConfigured
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _

Expand Down Expand Up @@ -162,22 +163,17 @@
MENU_SELECT_PARENTS = True
MENU_HIDE_EMPTY = False

# Group names
GROUP_SECRETARY = 'Secretaris'
GROUP_PRIMARY_SECRETARY = 'Primaire secretaris'
GROUP_LINGUISTICS_CHAMBER = 'LK'
GROUP_GENERAL_CHAMBER = 'AK'

# Route durations
PREASSESSMENT_ROUTE_WEEKS = 1
SHORT_ROUTE_WEEKS = 2

# Base URL
BASE_URL = '127.0.0.1:8000'

# CSRF Setting
CSRF_FAILURE_VIEW = 'main.error_views.csrf_failure'

try:
from .constants import *
except ImportError:
raise ImproperlyConfigured("constants.py is missing!")

try:
from .ldap_settings import *
except ImportError:
Expand All @@ -193,5 +189,8 @@
LOGIN_URL = reverse_lazy('saml-login')
SHOW_SAML_LOGIN = True

# Custom proxy model for SAML attribute processing
SAML_USER_MODEL = 'main.SamlUserProxy'

except ImportError:
print('Proceeding without SAML settings')
11 changes: 10 additions & 1 deletion fetc/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

# If SAML is enabled, add the required URL patterns for SAML
if 'cdh.federated_auth' in settings.INSTALLED_APPS:
from djangosaml2.views import LoginView
from djangosaml2.views import EchoAttributesView, LoginView
from cdh.federated_auth.saml.views import LogoutInitView

urlpatterns.extend([
Expand All @@ -65,6 +65,15 @@
path('saml/logout/', LogoutInitView.as_view(), name='logout'),
path('saml/', include('djangosaml2.urls')),
])

if settings.DEBUG:
urlpatterns.append(
path(
'saml/echo_attributes/',
EchoAttributesView.as_view(),
name='saml-attributes'
)
)
else:
# If not, append the default logout-view
urlpatterns.append(
Expand Down
Binary file modified locale/en/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit a990f3f

Please sign in to comment.