Update opolka/ScoDoc from ScoDoc/ScoDoc #2

Merged
opolka merged 1272 commits from ScoDoc/ScoDoc:master into master 2024-05-27 09:11:04 +02:00
3 changed files with 6 additions and 10 deletions
Showing only changes of commit 4f07bd677c - Show all commits

View File

@ -70,16 +70,11 @@ class Assiduite(db.Model):
def to_dict(self, format_api=True) -> dict:
"""Retourne la représentation json de l'assiduité"""
etat = self.etat
username = self.user_id
user: User = None
if format_api:
etat = EtatAssiduite.inverse().get(self.etat).name
if self.user_id is not None:
user: User = db.session.get(User, self.user_id)
if user is None:
username = "Non renseigné"
else:
username = user.get_prenomnom()
user = db.session.get(User, self.user_id)
data = {
"assiduite_id": self.id,
"etudid": self.etudid,
@ -90,7 +85,8 @@ class Assiduite(db.Model):
"etat": etat,
"desc": self.description,
"entry_date": self.entry_date,
"user_id": username,
"user_id": None if user is None else user.id, # l'uid
"user_name": None if user is None else user.user_name, # le login
"est_just": self.est_just,
"external_data": self.external_data,
}

View File

@ -884,7 +884,7 @@ def _make_listes_sem(formsemestre: FormSemestre) -> str:
jour = datetime.date.today().isoformat(),
group_ids=group.id,
)}">
<button>Visualiser l'assiduité</button></a>
<button>Visualiser</button></a>
</div>
<div>
<a class="btn" href="{

View File

@ -1,7 +1,7 @@
# -*- mode: python -*-
# -*- coding: utf-8 -*-
SCOVERSION = "9.6.36"
SCOVERSION = "9.6.37"
SCONAME = "ScoDoc"