Prise en charge de la photo de profil
Some checks failed
Organisation/sirh/pipeline/head There was a failure building this commit
Some checks failed
Organisation/sirh/pipeline/head There was a failure building this commit
This commit is contained in:
1
Jenkinsfile
vendored
1
Jenkinsfile
vendored
@@ -32,6 +32,7 @@ pipeline
|
||||
python manage.py migrate
|
||||
echo $SUDO_PASSWORD | sudo -S chown -R www-data:www-data /var/www/sirh
|
||||
echo "Deploiement reussi"
|
||||
echo $SUDO_PASSWORD | sudo -S supervisorctl restart sirh
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,37 +12,21 @@ https://docs.djangoproject.com/en/5.2/ref/settings/
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
<<<<<<< HEAD
|
||||
from decouple import config
|
||||
=======
|
||||
>>>>>>> c28b14f (clean: remove pycache from tracking)
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
>>>>>>> c28b14f (clean: remove pycache from tracking)
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
<<<<<<< HEAD
|
||||
SECRET_KEY = config('SECRET_KEY')
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = config('DEBUG', default=False, cast=bool)
|
||||
|
||||
ALLOWED_HOSTS = config('ALLOWED_HOSTS', default=[]).split(',')
|
||||
=======
|
||||
SECRET_KEY = 'django-insecure--wdb9t(77rvyac$_q!n5gw86&0r(0&&j171v9h!-_$jahsza*5'
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = False
|
||||
|
||||
ALLOWED_HOSTS = ["https://support.cerfig.org", "support.cerfig.org"]
|
||||
>>>>>>> c28b14f (clean: remove pycache from tracking)
|
||||
|
||||
# Application definition
|
||||
|
||||
@@ -95,7 +79,6 @@ WSGI_APPLICATION = 'SIRH.wsgi.application'
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
||||
|
||||
<<<<<<< HEAD
|
||||
|
||||
if config('ENVIRONMENT') == 'local':
|
||||
DATABASES = {
|
||||
@@ -115,26 +98,6 @@ else:
|
||||
'PORT': config('DATABASE_PORT'),
|
||||
}
|
||||
}
|
||||
=======
|
||||
# DATABASES = {
|
||||
# 'default': {
|
||||
# 'ENGINE': 'django.db.backends.mysql',
|
||||
# 'NAME': 'sirh',
|
||||
# 'USER': 'sirh',
|
||||
# 'PASSWORD': 'sirh-cerfig',
|
||||
# 'HOST': 'localhost',
|
||||
# 'PORT': '3306',
|
||||
# }
|
||||
# }
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
||||
}
|
||||
}
|
||||
|
||||
>>>>>>> c28b14f (clean: remove pycache from tracking)
|
||||
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
{% if user.employe.photo %}
|
||||
<img src="{{ user.employe.photo.url }}"
|
||||
class="rounded-circle"
|
||||
width="80"
|
||||
height="80"
|
||||
width="100"
|
||||
height="100"
|
||||
style="object-fit:cover;">
|
||||
{% else %}
|
||||
<i class="bi bi-person-circle text-white" style="font-size:60px;"></i>
|
||||
{% endif %}
|
||||
<div class="text-white mt-2">
|
||||
<div class="text-white mt-2 fw-bold fs-5">
|
||||
{{ user.username }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,15 +41,6 @@
|
||||
<a href="{% url 'gestion_salle:reservation-salle' %}" class="text-white fw-bold text-decoration-none mb-4" style="font-size:1.4em">
|
||||
<i class="bi bi-calendar-check"></i> Réservation
|
||||
</a>
|
||||
{% comment %} <a href="{% url 'rapport-rh' %}" class="text-white fw-bold text-decoration-none mb-2" style="font-size:1.2em">
|
||||
<i class="bi bi-graph-up"></i> Rapports et Statistiques
|
||||
</a> {% endcomment %}
|
||||
{% comment %} <a href="" class="text-white fw-bold text-decoration-none mb-2" style="font-size:1.2em">
|
||||
<i class="bi bi-person-gear"></i> Gestion des Utilisateurs
|
||||
</a> {% endcomment %}
|
||||
{% comment %} <a href="{% url 'gestion_employe:departement' %}" class="text-white fw-bold text-decoration-none mb-2" style="font-size:1.2em">
|
||||
<i class="bi bi-gear"></i> Paramètres
|
||||
</a> {% endcomment %}
|
||||
<a href="{% url 'deconnexion' %}" class="text-white fw-bold text-decoration-none mb-4" style="font-size:1.4em">
|
||||
<i class="bi bi-box-arrow-right"></i> Déconnexion
|
||||
</a>
|
||||
|
||||
@@ -15,10 +15,7 @@ class Employe(models.Model):
|
||||
FONCTION_LISTE = [
|
||||
('directeur', 'Directeur'),
|
||||
('assistant_direction', 'Assistante de direction'),
|
||||
<<<<<<< HEAD
|
||||
('assistant_technique_recherche', 'Assistant technique de recherche'),
|
||||
=======
|
||||
>>>>>>> c28b14f (clean: remove pycache from tracking)
|
||||
('comptable', 'Comptable'),
|
||||
('raf', 'RAF'),
|
||||
('data_manager', 'Data Manager'),
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
{% csrf_token %}
|
||||
<div class="col">
|
||||
<div class="form-group mb-2">
|
||||
<label>photo</label>
|
||||
<label>Photo</label>
|
||||
{% if employe.photo %}
|
||||
<span>Fichier actuel : <a href="{{ employe.photo.url }}">{{employe.photo}}</a></span>
|
||||
{% endif %}
|
||||
|
||||
@@ -79,21 +79,6 @@ urlpatterns = [
|
||||
views.modifier_mot_passe,
|
||||
name='modifier-mot-passe'
|
||||
),
|
||||
# path(
|
||||
# 'creation-departement/',
|
||||
# views.creation_departement,
|
||||
# name='creation-departement'
|
||||
# ),
|
||||
# path(
|
||||
# 'modifier-departement/',
|
||||
# views.modifier_departement,
|
||||
# name='modifier-departement'
|
||||
# ),
|
||||
# path(
|
||||
# 'suppression-departement/',
|
||||
# views.supprimer_departement,
|
||||
# name='suppression-departement/'
|
||||
# ),
|
||||
path(
|
||||
"liste-contrat-expirants",
|
||||
views.liste_contrat_expirants,
|
||||
|
||||
@@ -176,6 +176,7 @@ def modifier_mot_passe(request):
|
||||
messages.success(request, "Mot de passe modifié avec succès.")
|
||||
|
||||
return redirect("gestion_employe:mon-profil")
|
||||
|
||||
def modifier_employer(request):
|
||||
"""Vue pour permettre à un utilisateur de modifier les informations d'un employé"""
|
||||
try:
|
||||
@@ -204,13 +205,19 @@ def modifier_employer(request):
|
||||
return JsonResponse({"message": "Profil mis à jour avec succès."})
|
||||
|
||||
def enregistrement_document(request):
|
||||
"""Vue pour permettre à un utilisateur de télécharger et enregistrer des documents liés à son profil"""
|
||||
employe = Employe.objects.get(user=request.user)
|
||||
if request.method == "POST":
|
||||
if request.FILES.get("photo"):employe.photo = request.FILES["photo"]
|
||||
if "cv" in request.FILES:employe.CV = request.FILES["cv"]
|
||||
if "diplome" in request.FILES: employe.diplome = request.FILES["diplome"]
|
||||
if "rib" in request.FILES: employe.rib = request.FILES["rib"]
|
||||
if "casier_judiciaire" in request.FILES:employe.casier_judiciaire = request.FILES["casier_judiciaire"]
|
||||
if request.FILES.get("photo"):
|
||||
employe.photo = request.FILES["photo"]
|
||||
if "cv" in request.FILES:
|
||||
employe.CV = request.FILES["cv"]
|
||||
if "diplome" in request.FILES:
|
||||
employe.diplome = request.FILES["diplome"]
|
||||
if "rib" in request.FILES:
|
||||
employe.rib = request.FILES["rib"]
|
||||
if "casier_judiciaire" in request.FILES:
|
||||
employe.casier_judiciaire = request.FILES["casier_judiciaire"]
|
||||
employe.save()
|
||||
messages.success(request, "Documents enregistrés avec succès.")
|
||||
|
||||
@@ -407,41 +414,3 @@ def supprimer_formation(request, id_formation):
|
||||
formation.delete()
|
||||
messages.success(request, "Formation supprimée ")
|
||||
return redirect("mes_formations")
|
||||
|
||||
# @login_required
|
||||
# def creation_departement(request):
|
||||
# """Gère la création d'un nouveau département via un formulaire."""
|
||||
# if request.method == 'POST':
|
||||
# form_departement = DepartementForm(request.POST)
|
||||
# if form_departement.is_valid():
|
||||
# form_departement.save()
|
||||
# messages.success(request, "Département ajouté avec succès.")
|
||||
# else:
|
||||
# messages.error(request, "Erreur lors de l'ajout du département.")
|
||||
# return redirect('parametres-rh')
|
||||
|
||||
# @login_required
|
||||
# def modifier_departement(request, id):
|
||||
# """Gère la modification d'un département existant via un formulaire pré-rempli."""
|
||||
# departement = Departement.objects.get(id=id)
|
||||
# form = DepartementForm(instance=departement)
|
||||
# if request.method == 'POST':
|
||||
# nouveau_nom_departement = request.POST.get('nom')
|
||||
# if nouveau_nom_departement:
|
||||
# departement.nom = nouveau_nom_departement
|
||||
# departement.save()
|
||||
# messages.success(request, "Département modifié avec succès.")
|
||||
# return redirect('parametres-rh')
|
||||
# return render(request, 'gestion_employe/edit_departement.html', {
|
||||
# 'form': form,
|
||||
# 'departement': departement
|
||||
# })
|
||||
|
||||
# @login_required
|
||||
# def supprimer_departement(request, id):
|
||||
# """Gère la suppression d'un département existant."""
|
||||
# if request.method == "POST":
|
||||
# departement = Departement.objects.get(id=id)
|
||||
# departement.delete()
|
||||
# messages.success(request, "Département supprimé avec succès !")
|
||||
# return redirect('parametres-rh')
|
||||
|
||||
155
requirements.txt
155
requirements.txt
@@ -1,4 +1,3 @@
|
||||
<<<<<<< HEAD
|
||||
asgiref==3.11.1
|
||||
certifi==2026.4.22
|
||||
charset-normalizer==3.4.7
|
||||
@@ -20,157 +19,3 @@ tzdata==2026.2
|
||||
urllib3==2.6.3
|
||||
python-decouple
|
||||
gunicorn
|
||||
=======
|
||||
anyio==4.13.0
|
||||
argon2-cffi==25.1.0
|
||||
argon2-cffi-bindings==25.1.0
|
||||
arrow==1.4.0
|
||||
asgiref==3.11.0
|
||||
asttokens==3.0.1
|
||||
async-lru==2.3.0
|
||||
attrs==26.1.0
|
||||
Automat==20.2.0
|
||||
babel==2.18.0
|
||||
bcrypt==3.2.0
|
||||
beautifulsoup4==4.14.3
|
||||
bleach==6.3.0
|
||||
blinker==1.4
|
||||
certifi==2026.2.25
|
||||
cffi==2.0.0
|
||||
chardet==4.0.0
|
||||
charset-normalizer==3.4.7
|
||||
click==8.0.3
|
||||
cloud-init==25.3
|
||||
colorama==0.4.4
|
||||
comm==0.2.3
|
||||
command-not-found==0.3
|
||||
configobj==5.0.6
|
||||
constantly==15.1.0
|
||||
cryptography==3.4.8
|
||||
dbus-python==1.2.18
|
||||
debugpy==1.8.20
|
||||
decorator==5.2.1
|
||||
defusedxml==0.7.1
|
||||
distlib==0.4.0
|
||||
distro==1.7.0
|
||||
distro-info==1.1+ubuntu0.2
|
||||
Django==5.2.10
|
||||
et_xmlfile==2.0.0
|
||||
exceptiongroup==1.3.1
|
||||
executing==2.2.1
|
||||
fastjsonschema==2.21.2
|
||||
filelock==3.20.3
|
||||
fqdn==1.5.1
|
||||
h11==0.16.0
|
||||
httpcore==1.0.9
|
||||
httplib2==0.20.2
|
||||
httpx==0.28.1
|
||||
hyperlink==21.0.0
|
||||
idna==3.3
|
||||
importlib-metadata==4.6.4
|
||||
incremental==21.3.0
|
||||
ipykernel==7.2.0
|
||||
ipython==8.39.0
|
||||
isoduration==20.11.0
|
||||
jedi==0.19.2
|
||||
jeepney==0.7.1
|
||||
Jinja2==3.0.3
|
||||
json5==0.14.0
|
||||
jsonpatch==1.32
|
||||
jsonpointer==2.0
|
||||
jsonschema==4.26.0
|
||||
jsonschema-specifications==2025.9.1
|
||||
jupyter-events==0.12.0
|
||||
jupyter-lsp==2.3.1
|
||||
jupyter_client==8.8.0
|
||||
jupyter_core==5.9.1
|
||||
jupyter_server==2.17.0
|
||||
jupyter_server_terminals==0.5.4
|
||||
jupyterlab==4.5.6
|
||||
jupyterlab_pygments==0.3.0
|
||||
jupyterlab_server==2.28.0
|
||||
keyring==23.5.0
|
||||
lark==1.3.1
|
||||
launchpadlib==1.10.16
|
||||
lazr.restfulclient==0.14.4
|
||||
lazr.uri==1.0.6
|
||||
MarkupSafe==2.0.1
|
||||
matplotlib-inline==0.2.1
|
||||
mistune==3.2.0
|
||||
more-itertools==8.10.0
|
||||
nbclient==0.10.4
|
||||
nbconvert==7.17.0
|
||||
nbformat==5.10.4
|
||||
nest-asyncio==1.6.0
|
||||
netifaces==0.11.0
|
||||
notebook_shim==0.2.4
|
||||
numpy==2.2.6
|
||||
oauthlib==3.2.0
|
||||
openpyxl==3.1.5
|
||||
overrides==7.7.0
|
||||
packaging==26.0
|
||||
pandas==2.3.3
|
||||
pandocfilters==1.5.1
|
||||
parso==0.8.6
|
||||
pexpect==4.9.0
|
||||
platformdirs==4.5.1
|
||||
prometheus_client==0.24.1
|
||||
prompt_toolkit==3.0.52
|
||||
psutil==7.2.2
|
||||
ptyprocess==0.7.0
|
||||
pure_eval==0.2.3
|
||||
pyasn1==0.4.8
|
||||
pyasn1-modules==0.2.1
|
||||
pycparser==3.0
|
||||
pycurl==7.44.1
|
||||
Pygments==2.20.0
|
||||
PyGObject==3.42.1
|
||||
PyHamcrest==2.0.2
|
||||
PyJWT==2.3.0
|
||||
pyOpenSSL==21.0.0
|
||||
pyparsing==2.4.7
|
||||
pyrsistent==0.18.1
|
||||
pyserial==3.5
|
||||
python-apt==2.4.0+ubuntu4.1
|
||||
python-dateutil==2.9.0.post0
|
||||
python-json-logger==4.1.0
|
||||
pytz==2022.1
|
||||
PyYAML==5.4.1
|
||||
pyzmq==27.1.0
|
||||
referencing==0.37.0
|
||||
requests==2.33.1
|
||||
rfc3339-validator==0.1.4
|
||||
rfc3986-validator==0.1.1
|
||||
rfc3987-syntax==1.1.0
|
||||
rpds-py==0.30.0
|
||||
SecretStorage==3.3.1
|
||||
Send2Trash==2.1.0
|
||||
service-identity==18.1.0
|
||||
six==1.16.0
|
||||
soupsieve==2.8.3
|
||||
sqlparse==0.5.5
|
||||
ssh-import-id==5.11
|
||||
stack-data==0.6.3
|
||||
systemd-python==234
|
||||
terminado==0.18.1
|
||||
tinycss2==1.4.0
|
||||
tomli==2.4.1
|
||||
tornado==6.5.5
|
||||
traitlets==5.14.3
|
||||
Twisted==22.1.0
|
||||
typing_extensions==4.15.0
|
||||
tzdata==2025.3
|
||||
ubuntu-pro-client==8001
|
||||
ufw==0.36.1
|
||||
unattended-upgrades==0.1
|
||||
uri-template==1.3.0
|
||||
urllib3==1.26.5
|
||||
virtualenv==20.13.0+ds
|
||||
wadllib==1.3.6
|
||||
wcwidth==0.6.0
|
||||
webcolors==25.10.0
|
||||
webencodings==0.5.1
|
||||
websocket-client==1.9.0
|
||||
zipp==1.0.0
|
||||
zope.interface==5.4.0
|
||||
>>>>>>> c28b14f (clean: remove pycache from tracking)
|
||||
|
||||
Reference in New Issue
Block a user