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 dc4a9fd
Show file tree
Hide file tree
Showing 88 changed files with 141 additions and 213 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
46 changes: 2 additions & 44 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=standarderror-builtin,cmp-builtin,file-builtin,unicode-builtin,coerce-builtin,raising-string,nonzero-method,next-method-called,buffer-builtin,dict-view-method,zip-builtin-not-iterating,apply-builtin,filter-builtin-not-iterating,coerce-method,intern-builtin,unpacking-in-except,cmp-method,indexing-exception,old-raise-syntax,suppressed-message,xrange-builtin,oct-method,reduce-builtin,print-statement,old-division,execfile-builtin,old-octal-literal,reload-builtin,input-builtin,setslice-method,map-builtin-not-iterating,long-suffix,backtick,raw_input-builtin,round-builtin,hex-method,range-builtin-not-iterating,dict-iter-method,long-builtin,parameter-unpacking,unichr-builtin,getslice-method,metaclass-assignment,delslice-method,using-cmp-argument,import-star-module-level,basestring-builtin,useless-suppression,old-ne-operator,no-absolute-import,imported-auth-user
disable=suppressed-message,useless-suppression,imported-auth-user


[REPORTS]
Expand All @@ -66,12 +66,6 @@ disable=standarderror-builtin,cmp-builtin,file-builtin,unicode-builtin,coerce-bu
# mypackage.mymodule.MyReporterClass.
output-format=colorized

# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]". This option is deprecated
# and it will be removed in Pylint 2.0.
files-output=no

# Tells whether to display a full report or only the messages
reports=yes

Expand Down Expand Up @@ -99,12 +93,6 @@ ignore-long-lines=^\s*(# )?<?https?://\S+>?$
# else.
single-line-if-stmt=no

# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,dict-separator

# Maximum number of lines in a module
max-module-lines=1000

Expand Down Expand Up @@ -180,63 +168,33 @@ property-classes=abc.abstractproperty
# Regular expression matching correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

# Naming hint for module names
module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

# Regular expression matching correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for argument names
argument-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$

# Naming hint for class names
class-name-hint=[A-Z_][a-zA-Z0-9]+$

# Regular expression matching correct class attribute names
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$

# Naming hint for class attribute names
class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$

# Regular expression matching correct constant names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$

# Naming hint for constant names
const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$

# Regular expression matching correct method names
method-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for method names
method-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct inline iteration names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$

# Naming hint for inline iteration names
inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$

# Regular expression matching correct variable names
variable-rgx=[a-z_][a-z0-9_]{1,30}$

# Naming hint for variable names
variable-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for function names
function-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct attribute names
attr-rgx=[a-z_][a-z0-9_]{1,30}$

# Naming hint for attribute names
attr-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=^_
Expand Down Expand Up @@ -395,4 +353,4 @@ analyse-fallback-blocks=no

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
overgeneral-exceptions=builtins.Exception
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
Loading

0 comments on commit dc4a9fd

Please sign in to comment.