Skip to content

Commit

Permalink
Port to Django 3
Browse files Browse the repository at this point in the history
  • Loading branch information
bensmrs committed Mar 31, 2024
1 parent 6094ccc commit d0496ed
Show file tree
Hide file tree
Showing 85 changed files with 134 additions and 166 deletions.
3 changes: 1 addition & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ before_script:
- echo "CREATE DATABASE ${MYSQL_QOS_DATABASE}" | mysql -u${MYSQL_QOS_USER} -p${MYSQL_QOS_PASSWORD} -h ${MYSQL_QOS_HOST}
- source .install/scripts/install_openldap.sh
# - source .install/scripts/install_latex.sh
- pip3 install --upgrade pip
- pip3 install -qUr requirements.txt
- pip3 install --break-system-packages -qUr requirements.txt
- rm -f -- ${ROOTDIR}myresel/settings_local.py
- export MYSQL_USER=root
- source .install/scripts/configure.sh
Expand Down
15 changes: 4 additions & 11 deletions .install/etc/ldap/slapd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ loglevel 65535

# Where the dynamically loaded modules are stored
modulepath /usr/lib/ldap
moduleload back_bdb
moduleload back_hdb
moduleload back_mdb
#moduleload back_ldap
moduleload back_monitor
moduleload syncprov
Expand All @@ -71,7 +70,7 @@ tool-threads 1
# Specific Backend Directives for bdb:
# Backend specific directives apply to this backend until another
# 'backend' directive occurs
backend bdb
backend mdb

#######################################################
## Configuration relative a la gestion des accesslogs
Expand All @@ -96,7 +95,7 @@ backend bdb
# Specific Directives for database #1, of type bdb:
# Database specific directives apply to this databasse until another
# 'database' directive occurs
database bdb
database mdb

# The base of your directory in database #1
suffix "dc=maisel,dc=enst-bretagne,dc=fr"
Expand Down Expand Up @@ -185,9 +184,6 @@ syncprov-sessionlog 100
# These access lines apply to database #1 only
mode 0600

cachesize 100000
#dbcachesize 125829120 # seulement en LDBM

checkpoint 1024 10

# Ensure read access to the base for things like
Expand All @@ -208,7 +204,7 @@ checkpoint 1024 10
#database <other>

# The backend type, bdb, is the default standard
database bdb
database mdb

# The base of your directory in database #2
suffix "dc=resel,dc=enst-bretagne,dc=fr"
Expand Down Expand Up @@ -275,9 +271,6 @@ syncprov-sessionlog 100

mode 0600

cachesize 100000
#dbcachesize 5242880 seulement en LDBM

checkpoint 1024 10

# Activation du monitoring
Expand Down
2 changes: 1 addition & 1 deletion .install/scripts/install_essentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ else
apt-get -qq upgrade
fi

apt-get -qq install build-essential python3-software-properties python3 python3-dev python3-pip vim libssl-dev libmariadbclient-dev gcc
apt-get -qq install build-essential python3-software-properties python3 python3-dev python3-pip vim libssl-dev default-libmysqlclient-dev gcc pkg-config
#easy_install3 -U pip # Solve debian bug
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:10
FROM debian:12
ARG LDAPPASSWD

ARG DEBIAN_FRONTEND=noninteractive
Expand All @@ -15,8 +15,7 @@ RUN chmod +x install_essentials.sh && ./install_essentials.sh
RUN apt -qq update && apt -qq upgrade -y

COPY requirements.txt requirements.txt
RUN pip3 install --upgrade pip
RUN pip3 install -qr requirements.txt
RUN pip3 install --break-system-packages -qr requirements.txt

# LDAP
RUN apt -qq install expect ldap-utils libldap2-dev libsasl2-dev libssl-dev ldapvi -y
Expand Down
2 changes: 1 addition & 1 deletion campus/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.forms import ModelForm, CharField, TextInput, Form, Textarea, ChoiceField,\
EmailField, IntegerField, Select, CheckboxInput, SelectMultiple
from django.forms.models import ModelMultipleChoiceField
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.db.models import Q

from ldap3.core.exceptions import LDAPException
Expand Down
2 changes: 1 addition & 1 deletion campus/models/rooms_models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from dateutil.relativedelta import relativedelta
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist

Expand Down
2 changes: 1 addition & 1 deletion campus/templates/base_campus.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load staticfiles %}
{% load static %}
{% load i18n %}

<!DOCTYPE html>
Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/ae-admin/add-admin.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% load i18n %}
{% load staticfiles %}
{% load static %}

<script type="text/javascript">

Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/ae-admin/add-member.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load staticfiles %}
{% load static %}
{% load i18n %}

<script type="text/javascript">
Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/ae-admin/delete-admin.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% load i18n %}
{% load staticfiles %}
{% load static %}

<script type="text/javascript">

Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/ae-admin/export-csv.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load staticfiles %}
{% load static %}
{% load i18n %}

<script type="text/javascript">
Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/ae-admin/home.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "base_campus.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}

{% block title %}{% trans "Admin AE" %}{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/ae-admin/import-csv.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% load i18n %}
{% load staticfiles %}
{% load static %}

<script type="text/javascript">

Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/clubs/detail.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "base_campus.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% load clubs_extras %}

Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/clubs/list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "base_campus.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}
{% load clubs_extras %}

Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/clubs/new_club.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "base_campus.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}

{% block title %}Associations et clubs{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/home.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "base_campus.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}

{% block title %}Accueil Campus{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/mails/display.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "base_campus.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}

{% block title %}{% trans "Mails campus" %}{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/mails/need_moderation.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "base_campus.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}

{% block title %}{% trans "Modération des mails campus" %}{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/mails/send_mail.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "base_campus.html" %}
{% load staticfiles %}
{% load static %}

{% block title %}Envoyer un mail{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/rooms/booking_detail.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "base_campus.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}

{% block title %}Événement{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/rooms/calendar.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "base_campus.html" %}
{% load staticfiles %}
{% load static %}
{% load rooms_extras %}
{% load i18n %}

Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/rooms/room_form.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "base_campus.html" %}
{% load staticfiles %}
{% load static %}
{% load i18n %}

{% block title %} {% trans "Ajouter une salle"%} {% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/rooms/room_management.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "base_campus.html" %}
{% load rooms_extras %}
{% load staticfiles %}
{% load static %}
{% load i18n%}

{% block title %}{% trans "Gérer les salles" %}{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/whoswho/birthdayList.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "base_campus.html" %}
{% load i18n %}
{% load staticfiles %}
{% load static %}

{% block title %}{% trans 'Anniversaires' %}{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/whoswho/searchUsers.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "base_campus.html" %}
{% load i18n %}
{% load staticfiles %}
{% load static %}

{% block title %} Résultat {% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/whoswho/userDetails.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "base_campus.html" %}
{% load i18n %}
{% load staticfiles %}
{% load static %}

{% block title %}{{display_user.first_name}}{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion campus/templates/campus/whoswho/userHome.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "base_campus.html" %}
{% load i18n %}
{% load staticfiles %}
{% load static %}

{% block title %} WhosWho {% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion campus/views/views_ae_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.contrib.auth.decorators import login_required
from django.http import Http404, JsonResponse
from django.shortcuts import render
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.core.exceptions import ObjectDoesNotExist

from gestion_personnes.models import LdapUser
Expand Down
2 changes: 1 addition & 1 deletion campus/views/views_clubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
JsonResponse
from django.shortcuts import render, redirect
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.views.generic import FormView, View

from campus.forms import ClubManagementForm, ClubEditionForm
Expand Down
2 changes: 1 addition & 1 deletion campus/views/views_mails.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from django.shortcuts import render, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.contrib import messages
from django.urls import reverse
from django.core.mail import EmailMessage
Expand Down
2 changes: 1 addition & 1 deletion campus/views/views_rooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from django.shortcuts import render, get_object_or_404, redirect
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.contrib import messages
from django.utils import timezone
from django.contrib.auth.decorators import permission_required, login_required
Expand Down
2 changes: 1 addition & 1 deletion devices/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.core.exceptions import ObjectDoesNotExist
from django.core.mail import EmailMessage
from django.core.mail import mail_admins
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from fonctions import ldap
from devices.models import LdapDevice
Expand Down
4 changes: 2 additions & 2 deletions devices/templates/devices/add_device.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'base.html' %}
{% load i18n %}
{% load staticfiles %}
{% load static %}

{% block titre %}{% trans "Ajout de machine" %}{% endblock %}

Expand Down Expand Up @@ -43,4 +43,4 @@ <h1 class="page-header">{% trans "Ajouter une machine à votre compte" %}</h1>
$("#waiter").removeClass("hide");
});
</script>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion devices/templates/devices/list_devices.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'base.html' %}
{% load i18n %}
{% load staticfiles %}
{% load static %}

{% block titre %}{% trans "Mes machines" %}{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion devices/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.views.generic import FormView
from django.views.generic import View, ListView

Expand Down
Loading

0 comments on commit d0496ed

Please sign in to comment.