parent
ad3fdcc302
commit
c2ac3c4a1a
|
|
@ -4,21 +4,22 @@
|
|||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="04/01/26 - 21h30">
|
||||
<change afterPath="$PROJECT_DIR$/admission_mgt.py" afterDir="false" />
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="09/01/26 - 20h30">
|
||||
<change afterPath="$PROJECT_DIR$/session_admission_fi.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/GlobalVariable.py" beforeDir="false" afterPath="$PROJECT_DIR$/GlobalVariable.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Job_Cron.py" beforeDir="false" afterPath="$PROJECT_DIR$/Job_Cron.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/admission_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/admission_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/apprenant_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/apprenant_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/attached_file_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/attached_file_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/categorie_formation_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/categorie_formation_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/email_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/formulaire_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/formulaire_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/jury_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/jury_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partner_base_setup.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_base_setup.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partner_invoice.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_invoice.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partner_order.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_order.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ressources_humaines.py" beforeDir="false" afterPath="$PROJECT_DIR$/ressources_humaines.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/survey_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/survey_mgt.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
|
@ -461,7 +462,7 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1747251650255</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="524" />
|
||||
<option name="localTasksCounter" value="525" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
|
@ -503,7 +504,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="10/10/2025 - 17:30" />
|
||||
<MESSAGE value="12/10/2025 - 17:14 - Elyos V1.2" />
|
||||
<MESSAGE value="14/10/2025 - 23h" />
|
||||
<MESSAGE value="19/10/2025 - 14h" />
|
||||
|
|
@ -528,6 +528,7 @@
|
|||
<MESSAGE value="02/01/26 - 13h" />
|
||||
<MESSAGE value="02/01/26 - 21h" />
|
||||
<MESSAGE value="04/01/26 - 21h30" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="04/01/26 - 21h30" />
|
||||
<MESSAGE value="09/01/26 - 20h30" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="09/01/26 - 20h30" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -173,6 +173,8 @@ logging.basicConfig( level=DEBUG_LEVEL, filename=LOG_FILE_NAME)
|
|||
AUTORIZED_SOURCE_IPV4=["127.0.0.1", "localhost", "88.170.110.220", "192.168.1.21", "192.168.1.48", "51.77.211.142"]
|
||||
|
||||
|
||||
STORED_TYPE_FILE = ['pdf', 'png', 'jpg', 'jpeg', 'gif', 'webp']
|
||||
|
||||
#assign the default stopwords list to a variable
|
||||
STOP_WORDS = spacy.lang.fr.stop_words.STOP_WORDS
|
||||
stopWords = set(stopwords.words('french'))
|
||||
|
|
@ -753,7 +755,7 @@ PARTNER_BASE_CONFIG_NAME = ['tva', 'smtp_server', 'smtp_user', 'smtp_user_pwd',
|
|||
'recyclage_warning', 'recyclage_warning_lead_time',
|
||||
'preinscription_notification_email', 'inscription_notification_email','nb_heure_par_jour',
|
||||
'nb_heure_par_mois', 'nb_heure_par_annee', 'nb_heure_par_semaine',
|
||||
'annulation_inscription_notification_email']
|
||||
'annulation_inscription_notification_email', 'partner_devise']
|
||||
|
||||
|
||||
"""
|
||||
|
|
@ -1095,3 +1097,14 @@ sur les sessions, voici la liste des config_name à
|
|||
prendre """
|
||||
LIST_RELANCE_CONFIG_NAME = ['relance_auto', 'frequence_relance_auto', 'nb_relance_auto']
|
||||
LIST_RELANCE_RELATED_COLLECTION = ['survey', 'emargement', 'q_position']
|
||||
|
||||
|
||||
|
||||
"""
|
||||
download_files:
|
||||
Statut d'acceptation ou de rejet d'un fichier
|
||||
- "-1" => rejeté
|
||||
- "1" => accepté
|
||||
- "", rien
|
||||
"""
|
||||
DOWLOADED_FILE_ACCEPTANCE_STATUS = ['-1', '1', '']
|
||||
|
|
|
|||
528
Job_Cron.py
528
Job_Cron.py
|
|
@ -162,6 +162,7 @@ def Cron_Send_Survey():
|
|||
for val in MYSY_GV.dbname['survey'].find({"automatique_traitement":"1",
|
||||
'automatique_traitement_done':'0',
|
||||
'valide':'1',
|
||||
'statut': '1',
|
||||
'locked':'0'}) :
|
||||
|
||||
|
||||
|
|
@ -1646,6 +1647,533 @@ def Cron_Daily_Automatic_Qualiopi_Documents_For_Given_Partner(diction):
|
|||
return False, str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno)
|
||||
|
||||
|
||||
|
||||
|
||||
def Cron_Daily_Automatic_Qualiopi_Documents_For_Given_Partner_Isabelle(diction):
|
||||
try:
|
||||
print(" Cron : In function = Cron_Daily_Document_Sending")
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
|
||||
|
||||
incom_keys = diction.keys()
|
||||
|
||||
|
||||
|
||||
todays_date = str(date.today().strftime("%d/%m/%Y"))
|
||||
todays_date_ISODATE = datetime.strptime(str(todays_date), '%d/%m/%Y')
|
||||
|
||||
qry_list_session_concerned = {}
|
||||
qry_list_session_concerned['valide'] = "1"
|
||||
qry_list_session_concerned['automatic_traitement.actif'] = "1"
|
||||
qry_list_session_concerned['automatic_traitement.valide'] = "1"
|
||||
|
||||
qry_list_session_concerned['partner_owner_recid'] = "63fa37afab0a4f6692e44cc8ac080e3b25daae6edc6891fb27"
|
||||
|
||||
if( "code_session" in diction.keys() and diction['code_session']):
|
||||
qry_list_session_concerned['code_session'] = str(diction['code_session'])
|
||||
|
||||
# qry_list_session_concerned['automatic_traitement.statut'] = {"$ne": "2"}
|
||||
|
||||
print(" ### qry_list_session_concerned = ", qry_list_session_concerned)
|
||||
|
||||
for my_session in MYSY_GV.dbname['session_formation'].find(qry_list_session_concerned):
|
||||
print(" # Code Session = ", my_session['code_session'])
|
||||
print(" # Date Start Session = ", my_session['date_debut'])
|
||||
print(" # Date End Session = ", my_session['date_fin'])
|
||||
|
||||
# print(" # automatic_traitement = ", my_session['automatic_traitement'])
|
||||
diction_for_notification_email = {}
|
||||
diction_for_notification_email['session_id'] = str(my_session['_id'])
|
||||
diction_for_notification_email['tab_message'] = []
|
||||
diction_for_notification_email['global_status'] = []
|
||||
|
||||
for data_automatic_traitement in my_session['automatic_traitement']:
|
||||
if (data_automatic_traitement["actif"] == "1" and data_automatic_traitement["valide"] == "1" and
|
||||
data_automatic_traitement["statut"] != "2"):
|
||||
|
||||
print(" # Analyse Document = ", str(data_automatic_traitement['nom_document']),
|
||||
" Pour la session_code = ", str(my_session['code_session']), )
|
||||
print(" # Target Date = ", data_automatic_traitement['action_target_date'])
|
||||
print(" # Nb jour action = ", data_automatic_traitement['nb_jour_action'])
|
||||
print(" # Date du jour = ", str(todays_date))
|
||||
|
||||
local_status, nb_jour_action_Int = mycommon.IsInt(
|
||||
str(data_automatic_traitement['nb_jour_action']).strip())
|
||||
if (local_status is False):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][
|
||||
3]) + " CRON WARNING : nb_jour_action_Int n'est pas une valeur entière. Session Formation = ",
|
||||
str(my_session['_id']))
|
||||
# On log une erreur, et on continue le traitement dans la boucle.
|
||||
continue
|
||||
|
||||
local_session_start_date = datetime.strptime(str(my_session['date_debut']).strip(), '%d/%m/%Y')
|
||||
local_session_end_date = datetime.strptime(str(my_session['date_fin']).strip(), '%d/%m/%Y')
|
||||
local_session_target_date_added_nb_jour_action = ""
|
||||
local_session_target_date_added_nb_jour_action_formated = ""
|
||||
|
||||
if (data_automatic_traitement['action_target_date'] == "start_session"):
|
||||
local_session_target_date_added_nb_jour_action = local_session_start_date + timedelta(
|
||||
days=nb_jour_action_Int)
|
||||
local_session_target_date_added_nb_jour_action_formated = str(
|
||||
local_session_target_date_added_nb_jour_action.strftime("%d/%m/%Y"))
|
||||
|
||||
elif (data_automatic_traitement['action_target_date'] == "end_session"):
|
||||
local_session_target_date_added_nb_jour_action = local_session_end_date + timedelta(
|
||||
days=nb_jour_action_Int)
|
||||
local_session_target_date_added_nb_jour_action_formated = str(
|
||||
local_session_target_date_added_nb_jour_action.strftime("%d/%m/%Y"))
|
||||
|
||||
elif (data_automatic_traitement['action_target_date'] == "every_session_sequence_day"):
|
||||
"""
|
||||
Il faut aller voir si on a une sequence en date d'aujoud'hui pour cette session.
|
||||
Si oui, alors on local_session_target_date_added_nb_jour_action = date to day
|
||||
"""
|
||||
local_session_target_date_added_nb_jour_action = datetime.strptime(str(todays_date).strip(),
|
||||
'%d/%m/%Y')
|
||||
|
||||
elif (data_automatic_traitement['action_target_date'] == "preinscription"):
|
||||
"""
|
||||
Il faut aller voir si on a une sequence en date d'aujoud'hui pour cette session.
|
||||
Si oui, alors on local_session_target_date_added_nb_jour_action = date to day
|
||||
"""
|
||||
local_session_target_date_added_nb_jour_action = datetime.strptime(str(todays_date).strip(),
|
||||
'%d/%m/%Y')
|
||||
|
||||
print(" ### CMP 1 local_session_target_date_added_nb_jour_action = ",
|
||||
local_session_target_date_added_nb_jour_action)
|
||||
print(" ### CMP 2 datetime.strptime(str(todays_date).strip(), '%d/%m/%Y') = ",
|
||||
datetime.strptime(str(todays_date).strip(), '%d/%m/%Y'))
|
||||
|
||||
if (data_automatic_traitement['action_target_date'] != "preinscription" and
|
||||
data_automatic_traitement['action_target_date'] != "inscription"):
|
||||
if (data_automatic_traitement['action_target_date'] == "start_session"):
|
||||
print(" ### delta day (start_session) = ",
|
||||
datetime.strptime(str(todays_date).strip(), '%d/%m/%Y') - local_session_start_date)
|
||||
if (data_automatic_traitement['action_target_date'] == "end_session"):
|
||||
print(" ### delta day (end_session) = ",
|
||||
datetime.strptime(str(todays_date).strip(), '%d/%m/%Y') - local_session_end_date)
|
||||
|
||||
if (local_session_target_date_added_nb_jour_action > datetime.strptime(str(todays_date).strip(),
|
||||
'%d/%m/%Y')):
|
||||
print(" ### SUPPPPPP : Action à faire dans le futur ")
|
||||
|
||||
elif (local_session_target_date_added_nb_jour_action < datetime.strptime(
|
||||
str(todays_date).strip(), '%d/%m/%Y')):
|
||||
print(" ### INFFFFFF : Alert il y a un pb sur une action non realiser ")
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][
|
||||
3]) + " CRON WARNING * Cron_Daily_Document_Sending: Il a un CRON qui ne n'est pas exécuté à la date prévue."
|
||||
" Session Formation = " + str(
|
||||
my_session['_id']) + " Id du CRON courrier_template_type_document_id = " + str(
|
||||
data_automatic_traitement['courrier_template_type_document_id']))
|
||||
|
||||
courrier_template_type_document_data = MYSY_GV.dbname[
|
||||
'courrier_template_type_document'].find_one(
|
||||
{'ref_interne': data_automatic_traitement[
|
||||
'courrier_template_type_document_ref_interne'],
|
||||
'valide': '1',
|
||||
'locked': '0'})
|
||||
|
||||
node_notification = {}
|
||||
node_notification['message'] = "Cette tâche n'a pas été exécutée. " \
|
||||
" Date Initialement prévue " + str(
|
||||
local_session_target_date_added_nb_jour_action_formated)
|
||||
node_notification['status'] = "Warning"
|
||||
node_notification['action'] = str(courrier_template_type_document_data['ref_interne'])
|
||||
diction_for_notification_email['tab_message'].append(node_notification)
|
||||
diction_for_notification_email['global_status'].append("warning")
|
||||
|
||||
|
||||
elif (local_session_target_date_added_nb_jour_action == datetime.strptime(
|
||||
str(todays_date).strip(), '%d/%m/%Y')):
|
||||
|
||||
"""
|
||||
Effectuer l'action
|
||||
"""
|
||||
"""
|
||||
Recuperer le type de document concerné
|
||||
"""
|
||||
courrier_template_type_document_data = MYSY_GV.dbname[
|
||||
'courrier_template_type_document'].find_one(
|
||||
{'ref_interne': data_automatic_traitement[
|
||||
'courrier_template_type_document_ref_interne'],
|
||||
'valide': '1',
|
||||
'locked': '0'})
|
||||
|
||||
if (
|
||||
courrier_template_type_document_data and 'ref_interne' in courrier_template_type_document_data.keys()):
|
||||
print(" ### Action à faire : Envoyer le document de type ",
|
||||
courrier_template_type_document_data['ref_interne'])
|
||||
else:
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][
|
||||
3]) + " CRON WARNING * Cron_Daily_Document_Sending: Impossible de trouver le type de document concerné "
|
||||
" Session Formation = " + str(
|
||||
my_session['_id']) + " Id du CRON courrier_template_type_document_id = " + str(
|
||||
data_automatic_traitement['courrier_template_type_document_id']))
|
||||
|
||||
continue
|
||||
|
||||
# print(" ### avant action 1 courrier_template_type_document_data = ", courrier_template_type_document_data)
|
||||
# print(" ## data_automatic_traitement = ", data_automatic_traitement)
|
||||
|
||||
local_diction = {}
|
||||
local_diction['session_id'] = str(my_session['_id'])
|
||||
local_diction['document_ref_intern'] = str(
|
||||
courrier_template_type_document_data['ref_interne'])
|
||||
local_diction['partner_owner_recid'] = str(my_session['partner_owner_recid'])
|
||||
local_diction['courrier_template_type_document_ref_interne'] = str(
|
||||
data_automatic_traitement['courrier_template_type_document_ref_interne'])
|
||||
local_diction['courrier_template_type_document_id'] = str(
|
||||
data_automatic_traitement['courrier_template_type_document_id'])
|
||||
|
||||
# print( " ### local_diction for Send_document_from_base_document_automatic_setup = ", local_diction)
|
||||
local_status, local_retval = Send_document_from_base_document_automatic_setup(local_diction)
|
||||
|
||||
node_notification = {}
|
||||
node_notification['message'] = str(courrier_template_type_document_data['ref_interne'])
|
||||
|
||||
local_status_tanslate = ""
|
||||
if (local_status is True):
|
||||
local_status_tanslate = "Ok"
|
||||
else:
|
||||
local_status_tanslate = "Erreur"
|
||||
|
||||
node_notification['status'] = str(local_status_tanslate)
|
||||
node_notification['action'] = str(courrier_template_type_document_data['ref_interne'])
|
||||
diction_for_notification_email['tab_message'].append(node_notification)
|
||||
diction_for_notification_email['global_status'].append(str(local_status).lower())
|
||||
|
||||
"""
|
||||
Mettre à jour le document
|
||||
|
||||
Important : 17/04/25 : Lorsqu'il s'agit d'une action d'emargement avec un targuet = 'every_session_sequence_day', alors
|
||||
on ne desactive l'action que si la date du jous >= a la date de fin de session
|
||||
|
||||
"""
|
||||
if (data_automatic_traitement['action_target_date'] != "every_session_sequence_day" or
|
||||
(data_automatic_traitement['action_target_date'] == "every_session_sequence_day" and
|
||||
local_session_end_date <= datetime.strptime(str(todays_date).strip(),
|
||||
'%d/%m/%Y'))):
|
||||
|
||||
local_update = MYSY_GV.dbname['session_formation'].update_many(
|
||||
{'_id': ObjectId(str(my_session['_id'])),
|
||||
'partner_owner_recid': str(my_session['partner_owner_recid']),
|
||||
'valide': '1',
|
||||
'automatic_traitement.courrier_template_type_document_id': str(
|
||||
data_automatic_traitement['courrier_template_type_document_id'])
|
||||
},
|
||||
{'$set':
|
||||
{
|
||||
'automatic_traitement.$[xxx].actif': "-1",
|
||||
'automatic_traitement.$[xxx].statut': "2",
|
||||
'automatic_traitement.$[xxx].date_traitement_cron': str(datetime.now()),
|
||||
'automatic_traitement.$[xxx].date_update': str(datetime.now()),
|
||||
'automatic_traitement.$[xxx].update_by': "Automatic Cron",
|
||||
}
|
||||
},
|
||||
upsert=False,
|
||||
array_filters=[
|
||||
{"xxx.courrier_template_type_document_id": str(
|
||||
data_automatic_traitement['courrier_template_type_document_id'])}
|
||||
]
|
||||
|
||||
)
|
||||
if (local_update.matched_count < 1):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][
|
||||
3]) + " CRON WARNING * Cron_Daily_Document_Sending: La mise à jour du statut (actif = -1) du cron ne s'est "
|
||||
" PAS bien passé : Session Formation = " + str(my_session['_id']) +
|
||||
" Id du CRON courrier_template_type_document_id = " +
|
||||
str(data_automatic_traitement[
|
||||
'courrier_template_type_document_id']))
|
||||
|
||||
local_status, my_partner = mycommon.Get_Connected_User_Partner_Data_From_RecID(
|
||||
str(my_session['partner_owner_recid']))
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
diction_for_notification_email['token'] = str(my_partner['token'])
|
||||
|
||||
local_status, local_retval = Job_Cron_Common.Cron_Qualiopi_Automatic_Traitement_Notification(
|
||||
diction_for_notification_email)
|
||||
|
||||
return True, "OK"
|
||||
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
|
||||
return False, str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno)
|
||||
|
||||
|
||||
def Cron_Daily_Automatic_Qualiopi_Documents_For_Given_Partner_cherif(diction):
|
||||
try:
|
||||
print(" Cron : In function = Cron_Daily_Document_Sending")
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
|
||||
|
||||
incom_keys = diction.keys()
|
||||
|
||||
|
||||
|
||||
todays_date = str(date.today().strftime("%d/%m/%Y"))
|
||||
todays_date_ISODATE = datetime.strptime(str(todays_date), '%d/%m/%Y')
|
||||
|
||||
qry_list_session_concerned = {}
|
||||
qry_list_session_concerned['valide'] = "1"
|
||||
qry_list_session_concerned['automatic_traitement.actif'] = "1"
|
||||
qry_list_session_concerned['automatic_traitement.valide'] = "1"
|
||||
|
||||
qry_list_session_concerned['partner_owner_recid'] = "61a0d9e22b1d5aee266889f612ef5e51c5a69b1d59979bb25a"
|
||||
|
||||
if( "code_session" in diction.keys() and diction['code_session']):
|
||||
qry_list_session_concerned['code_session'] = str(diction['code_session'])
|
||||
|
||||
# qry_list_session_concerned['automatic_traitement.statut'] = {"$ne": "2"}
|
||||
|
||||
print(" ### qry_list_session_concerned = ", qry_list_session_concerned)
|
||||
|
||||
for my_session in MYSY_GV.dbname['session_formation'].find(qry_list_session_concerned):
|
||||
print(" # Code Session = ", my_session['code_session'])
|
||||
print(" # Date Start Session = ", my_session['date_debut'])
|
||||
print(" # Date End Session = ", my_session['date_fin'])
|
||||
|
||||
# print(" # automatic_traitement = ", my_session['automatic_traitement'])
|
||||
diction_for_notification_email = {}
|
||||
diction_for_notification_email['session_id'] = str(my_session['_id'])
|
||||
diction_for_notification_email['tab_message'] = []
|
||||
diction_for_notification_email['global_status'] = []
|
||||
|
||||
for data_automatic_traitement in my_session['automatic_traitement']:
|
||||
if (data_automatic_traitement["actif"] == "1" and data_automatic_traitement["valide"] == "1" and
|
||||
data_automatic_traitement["statut"] != "2"):
|
||||
|
||||
print(" # Analyse Document = ", str(data_automatic_traitement['nom_document']),
|
||||
" Pour la session_code = ", str(my_session['code_session']), )
|
||||
print(" # Target Date = ", data_automatic_traitement['action_target_date'])
|
||||
print(" # Nb jour action = ", data_automatic_traitement['nb_jour_action'])
|
||||
print(" # Date du jour = ", str(todays_date))
|
||||
|
||||
local_status, nb_jour_action_Int = mycommon.IsInt(
|
||||
str(data_automatic_traitement['nb_jour_action']).strip())
|
||||
if (local_status is False):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][
|
||||
3]) + " CRON WARNING : nb_jour_action_Int n'est pas une valeur entière. Session Formation = ",
|
||||
str(my_session['_id']))
|
||||
# On log une erreur, et on continue le traitement dans la boucle.
|
||||
continue
|
||||
|
||||
local_session_start_date = datetime.strptime(str(my_session['date_debut']).strip(), '%d/%m/%Y')
|
||||
local_session_end_date = datetime.strptime(str(my_session['date_fin']).strip(), '%d/%m/%Y')
|
||||
local_session_target_date_added_nb_jour_action = ""
|
||||
local_session_target_date_added_nb_jour_action_formated = ""
|
||||
|
||||
if (data_automatic_traitement['action_target_date'] == "start_session"):
|
||||
local_session_target_date_added_nb_jour_action = local_session_start_date + timedelta(
|
||||
days=nb_jour_action_Int)
|
||||
local_session_target_date_added_nb_jour_action_formated = str(
|
||||
local_session_target_date_added_nb_jour_action.strftime("%d/%m/%Y"))
|
||||
|
||||
elif (data_automatic_traitement['action_target_date'] == "end_session"):
|
||||
local_session_target_date_added_nb_jour_action = local_session_end_date + timedelta(
|
||||
days=nb_jour_action_Int)
|
||||
local_session_target_date_added_nb_jour_action_formated = str(
|
||||
local_session_target_date_added_nb_jour_action.strftime("%d/%m/%Y"))
|
||||
|
||||
elif (data_automatic_traitement['action_target_date'] == "every_session_sequence_day"):
|
||||
"""
|
||||
Il faut aller voir si on a une sequence en date d'aujoud'hui pour cette session.
|
||||
Si oui, alors on local_session_target_date_added_nb_jour_action = date to day
|
||||
"""
|
||||
local_session_target_date_added_nb_jour_action = datetime.strptime(str(todays_date).strip(),
|
||||
'%d/%m/%Y')
|
||||
|
||||
elif (data_automatic_traitement['action_target_date'] == "preinscription"):
|
||||
"""
|
||||
Il faut aller voir si on a une sequence en date d'aujoud'hui pour cette session.
|
||||
Si oui, alors on local_session_target_date_added_nb_jour_action = date to day
|
||||
"""
|
||||
local_session_target_date_added_nb_jour_action = datetime.strptime(str(todays_date).strip(),
|
||||
'%d/%m/%Y')
|
||||
|
||||
print(" ### CMP 1 local_session_target_date_added_nb_jour_action = ",
|
||||
local_session_target_date_added_nb_jour_action)
|
||||
print(" ### CMP 2 datetime.strptime(str(todays_date).strip(), '%d/%m/%Y') = ",
|
||||
datetime.strptime(str(todays_date).strip(), '%d/%m/%Y'))
|
||||
|
||||
if (data_automatic_traitement['action_target_date'] != "preinscription" and
|
||||
data_automatic_traitement['action_target_date'] != "inscription"):
|
||||
if (data_automatic_traitement['action_target_date'] == "start_session"):
|
||||
print(" ### delta day (start_session) = ",
|
||||
datetime.strptime(str(todays_date).strip(), '%d/%m/%Y') - local_session_start_date)
|
||||
if (data_automatic_traitement['action_target_date'] == "end_session"):
|
||||
print(" ### delta day (end_session) = ",
|
||||
datetime.strptime(str(todays_date).strip(), '%d/%m/%Y') - local_session_end_date)
|
||||
|
||||
if (local_session_target_date_added_nb_jour_action > datetime.strptime(str(todays_date).strip(),
|
||||
'%d/%m/%Y')):
|
||||
print(" ### SUPPPPPP : Action à faire dans le futur ")
|
||||
|
||||
elif (local_session_target_date_added_nb_jour_action < datetime.strptime(
|
||||
str(todays_date).strip(), '%d/%m/%Y')):
|
||||
print(" ### INFFFFFF : Alert il y a un pb sur une action non realiser ")
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][
|
||||
3]) + " CRON WARNING * Cron_Daily_Document_Sending: Il a un CRON qui ne n'est pas exécuté à la date prévue."
|
||||
" Session Formation = " + str(
|
||||
my_session['_id']) + " Id du CRON courrier_template_type_document_id = " + str(
|
||||
data_automatic_traitement['courrier_template_type_document_id']))
|
||||
|
||||
courrier_template_type_document_data = MYSY_GV.dbname[
|
||||
'courrier_template_type_document'].find_one(
|
||||
{'ref_interne': data_automatic_traitement[
|
||||
'courrier_template_type_document_ref_interne'],
|
||||
'valide': '1',
|
||||
'locked': '0'})
|
||||
|
||||
node_notification = {}
|
||||
node_notification['message'] = "Cette tâche n'a pas été exécutée. " \
|
||||
" Date Initialement prévue " + str(
|
||||
local_session_target_date_added_nb_jour_action_formated)
|
||||
node_notification['status'] = "Warning"
|
||||
node_notification['action'] = str(courrier_template_type_document_data['ref_interne'])
|
||||
diction_for_notification_email['tab_message'].append(node_notification)
|
||||
diction_for_notification_email['global_status'].append("warning")
|
||||
|
||||
|
||||
elif (local_session_target_date_added_nb_jour_action == datetime.strptime(
|
||||
str(todays_date).strip(), '%d/%m/%Y')):
|
||||
|
||||
"""
|
||||
Effectuer l'action
|
||||
"""
|
||||
"""
|
||||
Recuperer le type de document concerné
|
||||
"""
|
||||
courrier_template_type_document_data = MYSY_GV.dbname[
|
||||
'courrier_template_type_document'].find_one(
|
||||
{'ref_interne': data_automatic_traitement[
|
||||
'courrier_template_type_document_ref_interne'],
|
||||
'valide': '1',
|
||||
'locked': '0'})
|
||||
|
||||
if (
|
||||
courrier_template_type_document_data and 'ref_interne' in courrier_template_type_document_data.keys()):
|
||||
print(" ### Action à faire : Envoyer le document de type ",
|
||||
courrier_template_type_document_data['ref_interne'])
|
||||
else:
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][
|
||||
3]) + " CRON WARNING * Cron_Daily_Document_Sending: Impossible de trouver le type de document concerné "
|
||||
" Session Formation = " + str(
|
||||
my_session['_id']) + " Id du CRON courrier_template_type_document_id = " + str(
|
||||
data_automatic_traitement['courrier_template_type_document_id']))
|
||||
|
||||
continue
|
||||
|
||||
# print(" ### avant action 1 courrier_template_type_document_data = ", courrier_template_type_document_data)
|
||||
# print(" ## data_automatic_traitement = ", data_automatic_traitement)
|
||||
|
||||
local_diction = {}
|
||||
local_diction['session_id'] = str(my_session['_id'])
|
||||
local_diction['document_ref_intern'] = str(
|
||||
courrier_template_type_document_data['ref_interne'])
|
||||
local_diction['partner_owner_recid'] = str(my_session['partner_owner_recid'])
|
||||
local_diction['courrier_template_type_document_ref_interne'] = str(
|
||||
data_automatic_traitement['courrier_template_type_document_ref_interne'])
|
||||
local_diction['courrier_template_type_document_id'] = str(
|
||||
data_automatic_traitement['courrier_template_type_document_id'])
|
||||
|
||||
# print( " ### local_diction for Send_document_from_base_document_automatic_setup = ", local_diction)
|
||||
local_status, local_retval = Send_document_from_base_document_automatic_setup(local_diction)
|
||||
|
||||
node_notification = {}
|
||||
node_notification['message'] = str(courrier_template_type_document_data['ref_interne'])
|
||||
|
||||
local_status_tanslate = ""
|
||||
if (local_status is True):
|
||||
local_status_tanslate = "Ok"
|
||||
else:
|
||||
local_status_tanslate = "Erreur"
|
||||
|
||||
node_notification['status'] = str(local_status_tanslate)
|
||||
node_notification['action'] = str(courrier_template_type_document_data['ref_interne'])
|
||||
diction_for_notification_email['tab_message'].append(node_notification)
|
||||
diction_for_notification_email['global_status'].append(str(local_status).lower())
|
||||
|
||||
"""
|
||||
Mettre à jour le document
|
||||
|
||||
Important : 17/04/25 : Lorsqu'il s'agit d'une action d'emargement avec un targuet = 'every_session_sequence_day', alors
|
||||
on ne desactive l'action que si la date du jous >= a la date de fin de session
|
||||
|
||||
"""
|
||||
if (data_automatic_traitement['action_target_date'] != "every_session_sequence_day" or
|
||||
(data_automatic_traitement['action_target_date'] == "every_session_sequence_day" and
|
||||
local_session_end_date <= datetime.strptime(str(todays_date).strip(),
|
||||
'%d/%m/%Y'))):
|
||||
|
||||
local_update = MYSY_GV.dbname['session_formation'].update_many(
|
||||
{'_id': ObjectId(str(my_session['_id'])),
|
||||
'partner_owner_recid': str(my_session['partner_owner_recid']),
|
||||
'valide': '1',
|
||||
'automatic_traitement.courrier_template_type_document_id': str(
|
||||
data_automatic_traitement['courrier_template_type_document_id'])
|
||||
},
|
||||
{'$set':
|
||||
{
|
||||
'automatic_traitement.$[xxx].actif': "-1",
|
||||
'automatic_traitement.$[xxx].statut': "2",
|
||||
'automatic_traitement.$[xxx].date_traitement_cron': str(datetime.now()),
|
||||
'automatic_traitement.$[xxx].date_update': str(datetime.now()),
|
||||
'automatic_traitement.$[xxx].update_by': "Automatic Cron",
|
||||
}
|
||||
},
|
||||
upsert=False,
|
||||
array_filters=[
|
||||
{"xxx.courrier_template_type_document_id": str(
|
||||
data_automatic_traitement['courrier_template_type_document_id'])}
|
||||
]
|
||||
|
||||
)
|
||||
if (local_update.matched_count < 1):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][
|
||||
3]) + " CRON WARNING * Cron_Daily_Document_Sending: La mise à jour du statut (actif = -1) du cron ne s'est "
|
||||
" PAS bien passé : Session Formation = " + str(my_session['_id']) +
|
||||
" Id du CRON courrier_template_type_document_id = " +
|
||||
str(data_automatic_traitement[
|
||||
'courrier_template_type_document_id']))
|
||||
|
||||
local_status, my_partner = mycommon.Get_Connected_User_Partner_Data_From_RecID(
|
||||
str(my_session['partner_owner_recid']))
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
diction_for_notification_email['token'] = str(my_partner['token'])
|
||||
|
||||
local_status, local_retval = Job_Cron_Common.Cron_Qualiopi_Automatic_Traitement_Notification(
|
||||
diction_for_notification_email)
|
||||
|
||||
return True, "OK"
|
||||
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
|
||||
return False, str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Cette fonction prend en argument :
|
||||
- L'_id de la session de formation
|
||||
|
|
|
|||
21531
Log/log_file.log
21531
Log/log_file.log
File diff suppressed because one or more lines are too long
|
|
@ -190,7 +190,6 @@ def Add_Update_SessionFormation(diction):
|
|||
mydata['class_id'] = str(Class_data['_id'])
|
||||
class_id = str(Class_data['_id'])
|
||||
|
||||
print(" ")
|
||||
|
||||
#query_key['class_id'] = str(is_class_data['_id'])
|
||||
|
||||
|
|
@ -472,11 +471,11 @@ def Add_Update_SessionFormation(diction):
|
|||
if (datetime.strptime(str(diction['date_debut'])[0:10], '%d/%m/%Y') > datetime.strptime(str(diction['date_fin'])[0:10], '%d/%m/%Y')):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Session de Formation : La date debut " + str(
|
||||
3]) + " La date debut " + str(
|
||||
diction['date_debut'])[0:10] +
|
||||
" est postérieure à la date de fin " + str(diction['date_fin'])[0:10] )
|
||||
|
||||
return False, " Session de Formation : La date debut de formation " + str(diction['date_debut'])[0:10] + \
|
||||
return False, " La date debut de formation " + str(diction['date_debut'])[0:10] + \
|
||||
" est postérieure à la date de fin de formation " + str(diction['date_fin'])[0:10] + " "
|
||||
|
||||
# Verification de la cohérence des dates d'inscription si on a bien une date debut et une date de fin
|
||||
|
|
@ -487,31 +486,27 @@ def Add_Update_SessionFormation(diction):
|
|||
if (local_status is False):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " - Formation : " + str(
|
||||
code_session) + " : Impossible de créer/mettre à jour La promotion de formation. La date_debut_inscription n'est pas au format jj/mm/aaaa ")
|
||||
3]) + " La date_debut_inscription n'est pas au format jj/mm/aaaa ")
|
||||
|
||||
return False, " -Formation : " + str(
|
||||
code_session) + " : La date de début d'inscription n'est pas au format jj/mm/aaaa "
|
||||
return False, " La date de début d'inscription n'est pas au format jj/mm/aaaa "
|
||||
|
||||
local_status = mycommon.CheckisDate(str(diction['date_fin_inscription'])[0:10])
|
||||
if (local_status is False):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " -Formation : " + str(
|
||||
code_session) + " : La date de fin d'inscription n'est pas au format jj/mm/aaaa ")
|
||||
3]) + " La date de fin d'inscription n'est pas au format jj/mm/aaaa ")
|
||||
|
||||
return False, " - Formation : " + str(
|
||||
code_session) + " :La date de fin d'inscription n'est pas au format jj/mm/aaaa "
|
||||
return False, " La date de fin d'inscription n'est pas au format jj/mm/aaaa "
|
||||
|
||||
|
||||
if (datetime.strptime(str(diction['date_debut_inscription'])[0:10], '%d/%m/%Y') > datetime.strptime(
|
||||
str(diction['date_fin_inscription'])[0:10], '%d/%m/%Y')):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Formation : "+str(code_session)+" : La date de début d'inscription " + str(diction['date_debut_inscription'])[0:10] + \
|
||||
3]) + " La date de début d'inscription " + str(diction['date_debut_inscription'])[0:10] + \
|
||||
" est postérieure à la date de fin d'inscription " + str(diction['date_fin_inscription'])[0:10] + " " )
|
||||
|
||||
return False, " Formation : "+str(code_session)+" : La date de début d'inscription " + str(diction['date_debut_inscription'])[0:10] + \
|
||||
return False, " La date de début d'inscription " + str(diction['date_debut_inscription'])[0:10] + \
|
||||
" est postérieure à la date de fin d'inscription " + str(diction['date_fin_inscription'])[0:10] + " "
|
||||
|
||||
|
||||
|
|
@ -520,19 +515,19 @@ def Add_Update_SessionFormation(diction):
|
|||
if (datetime.strptime(str(diction['date_debut_inscription'])[0:10], '%d/%m/%Y') > datetime.strptime(
|
||||
str(diction['date_fin'])[0:10], '%d/%m/%Y')):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - Session de Formation : La date de debut d'inscription " + str( diction['date_debut_inscription'])+ " est postérieure à la date de fin de formation " + str(diction['date_fin']))
|
||||
str(inspect.stack()[0][3]) + " La date de debut d'inscription " + str( diction['date_debut_inscription'])+ " est postérieure à la date de fin de formation " + str(diction['date_fin']))
|
||||
|
||||
return False, " Session de Formation : La date de debut d'inscription " + str( diction['date_debut_inscription'])[0:10] + " est postérieure à la date de fin de formation " + str(diction['date_fin'])[0:10]+" "
|
||||
return False, " La date de debut d'inscription " + str( diction['date_debut_inscription'])[0:10] + " est postérieure à la date de fin de formation " + str(diction['date_fin'])[0:10]+" "
|
||||
|
||||
# Verification : Date de fin inscription n'est pas > date de fin de formation
|
||||
if (datetime.strptime(str(diction['date_fin_inscription'])[0:10], '%d/%m/%Y') > datetime.strptime(
|
||||
str(diction['date_fin'])[0:10], '%d/%m/%Y')):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " -Formation : "+str(code_session)+" : La date de fin d'inscription " + str(
|
||||
str(inspect.stack()[0][3]) + " La date de fin d'inscription " + str(
|
||||
diction['date_fin_inscription'])[0:10] + " est postérieure à la date de fin de la formation " + str(
|
||||
diction['date_fin'])[0:10])
|
||||
|
||||
return False, " Formation : "+str(code_session)+" : La date de fin d'inscription " + str(
|
||||
return False, " La date de fin d'inscription " + str(
|
||||
diction['date_fin_inscription'])[0:10] + " est postérieure à la date de fin de la formation " + str(
|
||||
diction['date_fin'])[0:10] + " "
|
||||
|
||||
|
|
|
|||
1271
admission_mgt.py
1271
admission_mgt.py
File diff suppressed because it is too large
Load Diff
|
|
@ -175,17 +175,17 @@ def Add_Apprenant(diction):
|
|||
return False, " Il existe déjà un apprenant avec la même adresse email. ",
|
||||
|
||||
|
||||
if( "is_handicap" in diction.keys() and str(diction['is_handicap']) not in ['0', '1']):
|
||||
if( "is_handicap" in diction.keys() and str(diction['is_handicap']) not in ['0', '1', '']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_handicap' est invalide ")
|
||||
return False, " Le champ 'is_handicap' est invalide "
|
||||
|
||||
if ("is_droit_image" in diction.keys() and str(diction['is_droit_image']) not in ['0', '1']):
|
||||
if ("is_droit_image" in diction.keys() and str(diction['is_droit_image']) not in ['0', '1', '']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_droit_image' est invalide ")
|
||||
return False, " Le champ 'is_droit_image' est invalide "
|
||||
|
||||
if ("is_rgpd" in diction.keys() and str(diction['is_rgpd']) not in ['0', '1']):
|
||||
if ("is_rgpd" in diction.keys() and str(diction['is_rgpd']) not in ['0', '1', '']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_rgpd' est invalide ")
|
||||
return False, " Le champ 'is_rgpd' est invalide "
|
||||
|
|
@ -356,17 +356,17 @@ def Update_Apprenant(diction):
|
|||
str(inspect.stack()[0][3]) + " L'identifiant du client n'est pas valide")
|
||||
return False, " L'identifiant du client n'est pas valide ",
|
||||
|
||||
if ("is_handicap" in diction.keys() and str(diction['is_handicap']) not in ['0', '1']):
|
||||
if ("is_handicap" in diction.keys() and str(diction['is_handicap']) not in ['0', '1', '']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_handicap' est invalide ")
|
||||
return False, " Le champ 'is_handicap' est invalide "
|
||||
|
||||
if ("is_droit_image" in diction.keys() and str(diction['is_droit_image']) not in ['0', '1']):
|
||||
if ("is_droit_image" in diction.keys() and str(diction['is_droit_image']) not in ['0', '1', '']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_droit_image' est invalide ")
|
||||
return False, " Le champ 'is_droit_image' est invalide "
|
||||
|
||||
if ("is_rgpd" in diction.keys() and str(diction['is_rgpd']) not in ['0', '1']):
|
||||
if ("is_rgpd" in diction.keys() and str(diction['is_rgpd']) not in ['0', '1', '']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_rgpd' est invalide ")
|
||||
return False, " Le champ 'is_rgpd' est invalide "
|
||||
|
|
@ -1638,7 +1638,7 @@ def Add_Update_Apprenant_Image(file_img=None, Folder=None, diction=None):
|
|||
recordimage_diction['related_collection_recid'] = str(apprenant_id_data['_id'])
|
||||
recordimage_diction['image_recid'] = diction['file_img_recid']
|
||||
|
||||
print(" ### recordimage_diction stagaire = ", recordimage_diction)
|
||||
#print(" ### recordimage_diction stagaire = ", recordimage_diction)
|
||||
local_status, local_message = mycommon.recordClassImage_v2(file_img, MYSY_GV.upload_folder, recordimage_diction)
|
||||
if( local_status is False):
|
||||
return local_status, local_message
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ def Store_User_Downloaded_File(file=None, Folder=None, diction=None):
|
|||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'file_business_object', 'file_name', 'status','object_owner_collection',
|
||||
'object_owner_id', 'type_document', 'metadata_field', 'tab_key_word']
|
||||
'object_owner_id', 'type_document', 'metadata_field', 'tab_key_word', 'admission_setup_document_id']
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list and val.startswith('my_') is False:
|
||||
|
|
@ -226,6 +226,9 @@ def Store_User_Downloaded_File(file=None, Folder=None, diction=None):
|
|||
mydata['creation_date'] = str(datetime.now())
|
||||
mydata['creation_by'] = str(my_partner['_id'])
|
||||
|
||||
if( "admission_setup_document_id" in diction.keys() ):
|
||||
mydata['admission_setup_document_id'] = str(diction['admission_setup_document_id'])
|
||||
|
||||
ret_val = MYSY_GV.dbname['download_files'].find_one_and_update({'file_business_object': str(file_business_object),
|
||||
'object_owner_collection':str(object_owner_collection),
|
||||
'object_owner_id':str(object_owner_id),
|
||||
|
|
@ -2023,3 +2026,89 @@ def Get_List_object_owner_collection_Stored_Files_With_Filter_No_Token(diction):
|
|||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible récupérer la liste des documents "
|
||||
|
||||
|
||||
"""
|
||||
Cette fonction permet de donner un statut d'acceptation ou non du document
|
||||
Ceci est par exemple utilisé dans le cas de procedures de candidature ou
|
||||
un candidat peut envoyer un document qui peut etre accepté ou rejeté
|
||||
|
||||
acceptance_status :
|
||||
- "-1" => rejeté
|
||||
- "1" => accepté
|
||||
- "", rien
|
||||
|
||||
"""
|
||||
def Acceptance_Stored_Downloaded_File_From_Id(diction):
|
||||
try:
|
||||
full_file_path = ""
|
||||
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
|
||||
|
||||
field_list = ['token', 'document_id', 'acceptance_status']
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list and val.startswith('my_') is False:
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le champ '" + val + "' n'est pas autorisé")
|
||||
return False, " Les informations fournies sont incorrectes",
|
||||
|
||||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', 'document_id', 'acceptance_status']
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - La valeur '" + val + "' n'est pas presente dans la liste des arguments ")
|
||||
return False, " Les informations fournies sont incorrectes",
|
||||
|
||||
"""
|
||||
Verification de l'identité et autorisation de l'entité qui
|
||||
appelle cette API
|
||||
"""
|
||||
token = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
token = diction['token']
|
||||
|
||||
if( diction['acceptance_status'] not in MYSY_GV.DOWLOADED_FILE_ACCEPTANCE_STATUS):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Le statut d'acceptation ou rejet du document est invalide. Les valeur autorisées sont "+str(MYSY_GV.DOWLOADED_FILE_ACCEPTANCE_STATUS ))
|
||||
return False, " Le statut d'acceptation ou rejet du document est invalide. Les valeur autorisées sont "+str(MYSY_GV.DOWLOADED_FILE_ACCEPTANCE_STATUS )
|
||||
|
||||
|
||||
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
data_cle = {}
|
||||
data_cle['partner_owner_recid'] = str(my_partner['recid'])
|
||||
data_cle['_id'] = ObjectId(diction['document_id'])
|
||||
data_cle['valide'] = "1"
|
||||
data_cle['locked'] = "0"
|
||||
|
||||
new_data = {}
|
||||
new_data['acceptance_status'] = diction['acceptance_status']
|
||||
new_data['update_date'] = str(datetime.now())
|
||||
new_data['update_by'] = str(my_partner['_id'])
|
||||
|
||||
result = MYSY_GV.dbname['download_files'].find_one_and_update(
|
||||
data_cle,
|
||||
{"$set": new_data},
|
||||
upsert=False,
|
||||
return_document=ReturnDocument.AFTER
|
||||
)
|
||||
|
||||
return True, " Le statut du document a été mise à jour "
|
||||
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible le statut du document"
|
||||
|
||||
|
|
|
|||
|
|
@ -124,8 +124,8 @@ def Add_Class_Categorie(diction):
|
|||
new_data['valide'] = "1"
|
||||
new_data['locked'] = "0"
|
||||
|
||||
new_data['date_update'] = str(datetime.now())
|
||||
new_data['update_by'] = str(my_partner['_id'])
|
||||
new_data['creation_date'] = str(datetime.now())
|
||||
new_data['creation_by'] = str(my_partner['_id'])
|
||||
new_data['partner_owner_recid'] = str(my_partner['recid'])
|
||||
|
||||
inserted_id = MYSY_GV.dbname['class_categorie'].insert_one(new_data).inserted_id
|
||||
|
|
@ -135,7 +135,7 @@ def Add_Class_Categorie(diction):
|
|||
return False, " Impossible de créer la catégorie de formation (2) "
|
||||
|
||||
|
||||
return True, " La categorie a été correctement ajoutée"
|
||||
return True, " La catégorie a été correctement ajoutée"
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
|
|
@ -208,7 +208,7 @@ def Update_Class_Categorie(diction):
|
|||
del diction['_id']
|
||||
|
||||
|
||||
new_data['date_update'] = str(datetime.now())
|
||||
new_data['update_date'] = str(datetime.now())
|
||||
new_data['update_by'] = str(my_partner['_id'])
|
||||
|
||||
data_cle = {}
|
||||
|
|
|
|||
17
email_mgt.py
17
email_mgt.py
|
|
@ -2512,7 +2512,7 @@ def ManualSendInvoiceEmailRIB_CIC_JMJFormation(diction):
|
|||
body = {
|
||||
"params": {"order_id": "MTT/2025_N°0012/JMJ FORMATION",
|
||||
"date_order": ": 14/07/2025",
|
||||
"periode":"14/12/2025 au 13/01/2026",
|
||||
"periode":"14/01/2026 au 13/02/2026",
|
||||
"total_ht": "130",
|
||||
"tva": "11.05",
|
||||
"total_ttc": "141,05 ",
|
||||
|
|
@ -2528,9 +2528,9 @@ def ManualSendInvoiceEmailRIB_CIC_JMJFormation(diction):
|
|||
"montant": "130 €",
|
||||
|
||||
|
||||
"invoice_id": "FACT_20251215",
|
||||
"invoice_date": "21/12/2025",
|
||||
"due_date": "21/12/2025",
|
||||
"invoice_id": "FACT_20260116",
|
||||
"invoice_date": "18/01/2026",
|
||||
"due_date": "18/01/2026",
|
||||
"orign_order": "Contrat MTT/2025_N°0012/JMJ FORMATION",
|
||||
}
|
||||
}
|
||||
|
|
@ -2564,7 +2564,7 @@ def ManualSendInvoiceEmailRIB_CIC_JMJFormation(diction):
|
|||
#print(" ### body 22 = ", body)
|
||||
|
||||
sourceHtml = template.render(json_data=body["params"])
|
||||
orig_file_name = "invoice_FACT_20251215.pdf"
|
||||
orig_file_name = "invoice_FACT_20260116.pdf"
|
||||
outputFilename = str(MYSY_GV.INVOICE_DIRECTORY) + str(orig_file_name)
|
||||
|
||||
# open output file for writing (truncated binary)
|
||||
|
|
@ -4065,6 +4065,8 @@ def Prepare_and_Send_Email_From_Front_For_Unknown_Contact(tab_files, Folder, dic
|
|||
local_diction['initial_message'] = sourceHtml
|
||||
local_diction['email_to'] = str(local_email_dest)
|
||||
|
||||
|
||||
|
||||
local_status, local_retval = send_invidual_email (local_diction)
|
||||
if( local_status is False ):
|
||||
return local_status, local_retval
|
||||
|
|
@ -4083,7 +4085,6 @@ def Prepare_and_Send_Email_From_Front_For_Unknown_Contact(tab_files, Folder, dic
|
|||
|
||||
"""
|
||||
Envoi d'un email email individuel.
|
||||
|
||||
"""
|
||||
def send_invidual_email(diction):
|
||||
try:
|
||||
|
|
@ -4195,7 +4196,7 @@ def send_invidual_email(diction):
|
|||
queue_mail_diction['tab_email_bcc'] = tab_email_bcc
|
||||
queue_mail_diction['email_sujet'] = email_sujet
|
||||
queue_mail_diction['email_to'] = str(email_to)
|
||||
queue_mail_diction['message'] = diction['initial_message']
|
||||
queue_mail_diction['message'] = str(html_mime)
|
||||
|
||||
queue_mail_diction['smtp_account_password'] = local_SMTP_COUNT_password
|
||||
queue_mail_diction['smtp_account_smtpsrv'] = local_SMTP_COUNT_smtpsrv
|
||||
|
|
@ -4207,7 +4208,7 @@ def send_invidual_email(diction):
|
|||
if( "tab_saved_file_full_path" in diction.keys() ):
|
||||
queue_mail_diction['tab_files_to_attache_to_mail'] = diction['tab_saved_file_full_path']
|
||||
else:
|
||||
queue_mail_diction = []
|
||||
queue_mail_diction["tab_files_to_attache_to_mail"] = []
|
||||
|
||||
internal_mail_diction = {}
|
||||
for tmp in queue_mail_diction.keys() :
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ def Add_Formulaire(diction):
|
|||
return False, " Un formulaire avec le même code existe déjà "
|
||||
|
||||
mydata['creation_date'] = str(datetime.now())
|
||||
mydata['update_by'] = str(my_partner['_id'])
|
||||
mydata['creation_by'] = str(my_partner['_id'])
|
||||
mydata['partner_owner_recid'] = str(my_partner['recid'])
|
||||
mydata['valide'] = "1"
|
||||
mydata['locked'] = "0"
|
||||
|
|
|
|||
255
jury_mgt.py
255
jury_mgt.py
|
|
@ -78,7 +78,7 @@ def Add_Jury(diction):
|
|||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', 'code', ]
|
||||
field_list_obligatoire = ['token', 'code', 'cible']
|
||||
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
|
|
@ -120,7 +120,8 @@ def Add_Jury(diction):
|
|||
"""
|
||||
Si session_id, verifier la validité de la session
|
||||
"""
|
||||
if ('session_id' in diction.keys() and diction['session_id']):
|
||||
|
||||
if ( diction['cible'] != 'admission' and 'session_id' in diction.keys() and diction['session_id']):
|
||||
is_valide_session_id = MYSY_GV.dbname['session_formation'].count_documents(
|
||||
{'_id': ObjectId(str(diction['session_id'])),
|
||||
'partner_owner_recid': my_partner[
|
||||
|
|
@ -133,6 +134,20 @@ def Add_Jury(diction):
|
|||
str(inspect.stack()[0][3]) + " L'identifiant de la session (class) est invalide ")
|
||||
return False, " L'identifiant de la session (class) est invalide "
|
||||
|
||||
|
||||
elif ( diction['cible'] == 'admission' and 'session_id' in diction.keys() and diction['session_id']):
|
||||
is_valide_session_id = MYSY_GV.dbname['admission_session'].count_documents(
|
||||
{'_id': ObjectId(str(diction['session_id'])),
|
||||
'partner_owner_recid': my_partner[
|
||||
'recid'],
|
||||
'valide': '1',
|
||||
})
|
||||
|
||||
if (is_valide_session_id != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant de la session d'admission est invalide ")
|
||||
return False, " L'identifiant de la session d'admission est invalide "
|
||||
|
||||
"""
|
||||
Verifier la validité du groupe d'apprenant
|
||||
"""
|
||||
|
|
@ -153,7 +168,7 @@ def Add_Jury(diction):
|
|||
"""
|
||||
Verifier la validité de la formation
|
||||
"""
|
||||
if ("class_id" in diction.keys() and diction['class_id']):
|
||||
if ( diction['cible'] == 'admission' and "class_id" in diction.keys() and diction['class_id']):
|
||||
is_valide_class_id = MYSY_GV.dbname['myclass'].count_documents(
|
||||
{'_id': ObjectId(str(diction['class_id'])),
|
||||
'partner_owner_recid': my_partner[
|
||||
|
|
@ -1230,7 +1245,7 @@ def Update_Jury(diction):
|
|||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', '_id',]
|
||||
field_list_obligatoire = ['token', '_id', 'cible']
|
||||
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
|
|
@ -1317,7 +1332,7 @@ def Update_Jury(diction):
|
|||
"""
|
||||
Si session_id, verifier la validité de la session
|
||||
"""
|
||||
if ('session_id' in diction.keys() and diction['session_id']):
|
||||
if ( diction['cible'] != 'admission' and 'session_id' in diction.keys() and diction['session_id']):
|
||||
is_valide_session_id = MYSY_GV.dbname['session_formation'].count_documents(
|
||||
{'_id': ObjectId(str(diction['session_id'])),
|
||||
'partner_owner_recid': my_partner[
|
||||
|
|
@ -1330,6 +1345,19 @@ def Update_Jury(diction):
|
|||
str(inspect.stack()[0][3]) + " L'identifiant de la session (promotion) est invalide ")
|
||||
return False, " L'identifiant de la session (promotion) est invalide "
|
||||
|
||||
elif ( diction['cible'] == 'admission' and 'session_id' in diction.keys() and diction['session_id']):
|
||||
is_valide_session_id = MYSY_GV.dbname['admission_session'].count_documents(
|
||||
{'_id': ObjectId(str(diction['session_id'])),
|
||||
'partner_owner_recid': my_partner[
|
||||
'recid'],
|
||||
'valide': '1',
|
||||
})
|
||||
|
||||
if (is_valide_session_id != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant de la session d'admission est invalide ")
|
||||
return False, " L'identifiant de la session d'admission est invalide "
|
||||
|
||||
"""
|
||||
Verifier la validité du groupe d'apprenant
|
||||
"""
|
||||
|
|
@ -2678,7 +2706,7 @@ def Get_List_jury_With_Filter(diction):
|
|||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'code', 'description', 'membre', ]
|
||||
field_list = ['token', 'code', 'description', 'membre', 'cible']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -2714,6 +2742,10 @@ def Get_List_jury_With_Filter(diction):
|
|||
if ("description" in diction.keys()):
|
||||
filt_description = {'description': {'$regex': str(diction['description']), "$options": "i"}}
|
||||
|
||||
filt_cible = {}
|
||||
if ("cible" in diction.keys()):
|
||||
filt_cible = {'cible': {'$regex': str(diction['cible']), "$options": "i"}}
|
||||
|
||||
|
||||
filt_code = {}
|
||||
if ("code" in diction.keys()):
|
||||
|
|
@ -2745,7 +2777,7 @@ def Get_List_jury_With_Filter(diction):
|
|||
|
||||
find_qry = {
|
||||
'$and': [{'partner_owner_recid': str(my_partner['recid']), 'valide': '1', 'locked': '0'}, filt_description,
|
||||
filt_code, ]}
|
||||
filt_code, filt_cible]}
|
||||
local_new_myquery_find_team = ""
|
||||
|
||||
if ("membre" in diction.keys()):
|
||||
|
|
@ -2818,7 +2850,7 @@ def Get_List_jury_With_Filter(diction):
|
|||
user['class_id'] = ""
|
||||
|
||||
code_session = ""
|
||||
if ("session_id" in local_New_retVal.keys()):
|
||||
if (local_New_retVal['cible'] != "admission" and "session_id" in local_New_retVal.keys()):
|
||||
user['session_id'] = local_New_retVal['session_id']
|
||||
session_id_data = MYSY_GV.dbname['session_formation'].find_one(
|
||||
{'_id': ObjectId(str(user['session_id'])),
|
||||
|
|
@ -2829,6 +2861,18 @@ def Get_List_jury_With_Filter(diction):
|
|||
if (session_id_data and "code_session" in session_id_data.keys()):
|
||||
code_session = session_id_data['code_session']
|
||||
|
||||
|
||||
elif (local_New_retVal['cible'] == "admission" and "session_id" in local_New_retVal.keys()):
|
||||
user['session_id'] = local_New_retVal['session_id']
|
||||
session_id_data = MYSY_GV.dbname['admission_session'].find_one(
|
||||
{'_id': ObjectId(str(user['session_id'])),
|
||||
'valide': '1',
|
||||
'partner_owner_recid': str(
|
||||
my_partner['recid'])})
|
||||
|
||||
if (session_id_data and "code_session" in session_id_data.keys()):
|
||||
code_session = session_id_data['code_session']
|
||||
|
||||
else:
|
||||
user['session_id'] = ""
|
||||
|
||||
|
|
@ -2861,7 +2905,7 @@ def Get_List_jury_With_Filter(diction):
|
|||
user['cible'] = ""
|
||||
|
||||
|
||||
if ("ue_id" in local_New_retVal.keys()):
|
||||
if ("ue_id" in local_New_retVal.keys() and local_New_retVal['ue_id']):
|
||||
user['ue_id'] = local_New_retVal['ue_id']
|
||||
ue_id_data = MYSY_GV.dbname['unite_enseignement'].find_one({'_id': ObjectId(str(user['ue_id'])),
|
||||
'valide': '1',
|
||||
|
|
@ -2941,7 +2985,7 @@ def Add_Update_Apprenant_To_Jury(diction):
|
|||
field_list = ['token', '_id', 'tab_inscriptions_ids', 'agenda_id', 'jury_seance_ue_id',
|
||||
'event_start', 'event_end', 'jury_soutenance_id', 'jury_soutenance_salle',
|
||||
'jury_soutenance_adresse', 'jury_soutenance_code_postal', 'jury_soutenance_ville',
|
||||
'jury_soutenance_pays']
|
||||
'jury_soutenance_pays', ]
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -3004,20 +3048,40 @@ def Add_Update_Apprenant_To_Jury(diction):
|
|||
tab_inscriptions_ids = diction['tab_inscriptions_ids']
|
||||
|
||||
|
||||
print(" ### jury_data = ", jury_data)
|
||||
|
||||
print(" ### cible = ", str(jury_data['cible']))
|
||||
|
||||
jury_cible = str(jury_data['cible'])
|
||||
|
||||
tab_inscriptions_ids_splited = str(tab_inscriptions_ids).split(",")
|
||||
# Controle de validité des inscriptions
|
||||
for my_inscription in tab_inscriptions_ids_splited:
|
||||
if(my_inscription ):
|
||||
# Verifier que l'inscription est valide
|
||||
my_inscription_is_valide = MYSY_GV.dbname['inscription'].count_documents(
|
||||
{'_id': ObjectId(str(my_inscription)),
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
if (my_inscription_is_valide != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'inscription_id '" + my_inscription + "' est invalide ")
|
||||
return False, " L'inscription_id '" + my_inscription + "' est invalide ", False, False
|
||||
if( jury_cible != 'admission'):
|
||||
for my_inscription in tab_inscriptions_ids_splited:
|
||||
if(my_inscription ):
|
||||
# Verifier que l'inscription est valide
|
||||
my_inscription_is_valide = MYSY_GV.dbname['inscription'].count_documents(
|
||||
{'_id': ObjectId(str(my_inscription)),
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
if (my_inscription_is_valide != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'inscription_id '" + my_inscription + "' est invalide ")
|
||||
return False, " L'inscription_id '" + my_inscription + "' est invalide ", False, False
|
||||
|
||||
elif ( jury_cible == 'admission'):
|
||||
for my_inscription in tab_inscriptions_ids_splited:
|
||||
if(my_inscription ):
|
||||
# Verifier que l'inscription est valide
|
||||
my_inscription_is_valide = MYSY_GV.dbname['admission_session_inscrit'].count_documents(
|
||||
{'_id': ObjectId(str(my_inscription)),
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
if (my_inscription_is_valide != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'inscription_id '" + my_inscription + "' est invalide - admission_session_inscrit ")
|
||||
return False, " Le candidat '" + my_inscription + "' est invalide ", False, False
|
||||
|
||||
soutenance_inserted_id = str(diction['jury_soutenance_id'])
|
||||
agenda_inserted_id = str(diction['agenda_id'])
|
||||
|
|
@ -3032,6 +3096,7 @@ def Add_Update_Apprenant_To_Jury(diction):
|
|||
# Il s'agit d'un primo creation, il faut créer l'agenda et la soutenance
|
||||
new_soutenance_data = {}
|
||||
new_soutenance_data['jury_id'] = str(diction['_id'])
|
||||
new_soutenance_data['jury_cible'] = str(jury_cible)
|
||||
new_soutenance_data['locked'] = "0"
|
||||
new_soutenance_data['valide'] = "1"
|
||||
new_soutenance_data['partner_owner_recid'] = str(my_partner['recid'])
|
||||
|
|
@ -3223,6 +3288,7 @@ def Add_Update_Apprenant_To_Jury(diction):
|
|||
|
||||
my_even_data = {}
|
||||
my_even_data['related_collection'] = "jury"
|
||||
|
||||
my_even_data['related_collection_recid'] = str(diction['_id'])
|
||||
my_even_data['event_title'] = "Jury : " + str(jury_data['code'])
|
||||
my_even_data['event_start'] = str(diction['event_start'])
|
||||
|
|
@ -3249,6 +3315,7 @@ def Add_Update_Apprenant_To_Jury(diction):
|
|||
for my_inscription in tab_inscriptions_ids_splited:
|
||||
new_data = {}
|
||||
new_data['jury_id'] = str(diction['_id'])
|
||||
new_data['jury_cible'] = str(jury_cible)
|
||||
new_data['inscription_id'] = str(my_inscription)
|
||||
new_data['agenda_id'] = str(agenda_inserted_id)
|
||||
new_data['jury_soutenance_id'] = str(soutenance_inserted_id)
|
||||
|
|
@ -3453,7 +3520,7 @@ def Get_Given_Jury_Apprenant_With_Filter(diction):
|
|||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', '_id', 'agenda_id', 'ue_id', 'jury_soutenance_id']
|
||||
field_list = ['token', '_id', 'agenda_id', 'ue_id', 'jury_soutenance_id', 'jury_cible']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -3517,31 +3584,47 @@ def Get_Given_Jury_Apprenant_With_Filter(diction):
|
|||
prenom = ""
|
||||
email = ""
|
||||
|
||||
if(retval['inscription_id'] ):
|
||||
local_new_dict = {}
|
||||
local_new_dict['token'] = diction['token']
|
||||
local_new_dict['inscrit_id'] = retval['inscription_id']
|
||||
if( "jury_cible" in diction.keys() and diction['jury_cible'] == "admission"):
|
||||
if (retval['inscription_id']):
|
||||
local_inscrit_data_retval = MYSY_GV.dbname['admission_session_inscrit'].find_one({"_id":ObjectId(str(retval['inscription_id'])),
|
||||
'valide':'1',
|
||||
'partner_owner_recid':str(my_partner['recid'])})
|
||||
|
||||
local_inscrit_data_status, local_inscrit_data_retval = mycommon.Get_Inscrit_And_Apprenant_Data(
|
||||
local_new_dict)
|
||||
if (local_inscrit_data_status is False):
|
||||
return local_inscrit_data_status, local_inscrit_data_retval
|
||||
if( local_inscrit_data_retval and "nom" in local_inscrit_data_retval.keys()):
|
||||
nom = local_inscrit_data_retval['nom']
|
||||
|
||||
if ("inscrit_data" in local_inscrit_data_retval.keys()):
|
||||
user['inscrit_data'] = local_inscrit_data_retval['inscrit_data']
|
||||
if (local_inscrit_data_retval and "prenom" in local_inscrit_data_retval.keys()):
|
||||
prenom = local_inscrit_data_retval['prenom']
|
||||
|
||||
nom = local_inscrit_data_retval['inscrit_data']['nom']
|
||||
prenom = local_inscrit_data_retval['inscrit_data']['prenom']
|
||||
email = local_inscrit_data_retval['inscrit_data']['email']
|
||||
if (local_inscrit_data_retval and "email" in local_inscrit_data_retval.keys()):
|
||||
email = local_inscrit_data_retval['email']
|
||||
|
||||
else:
|
||||
if(retval['inscription_id'] ):
|
||||
local_new_dict = {}
|
||||
local_new_dict['token'] = diction['token']
|
||||
local_new_dict['inscrit_id'] = retval['inscription_id']
|
||||
|
||||
local_inscrit_data_status, local_inscrit_data_retval = mycommon.Get_Inscrit_And_Apprenant_Data(
|
||||
local_new_dict)
|
||||
if (local_inscrit_data_status is False):
|
||||
return local_inscrit_data_status, local_inscrit_data_retval
|
||||
|
||||
if ("inscrit_data" in local_inscrit_data_retval.keys()):
|
||||
user['inscrit_data'] = local_inscrit_data_retval['inscrit_data']
|
||||
|
||||
nom = local_inscrit_data_retval['inscrit_data']['nom']
|
||||
prenom = local_inscrit_data_retval['inscrit_data']['prenom']
|
||||
email = local_inscrit_data_retval['inscrit_data']['email']
|
||||
|
||||
|
||||
if ("apprenant_data" in local_inscrit_data_retval.keys()):
|
||||
user['apprenant_data'] = local_inscrit_data_retval['apprenant_data']
|
||||
if ("apprenant_data" in local_inscrit_data_retval.keys()):
|
||||
user['apprenant_data'] = local_inscrit_data_retval['apprenant_data']
|
||||
|
||||
# Si on a un dossier apprenant, alors on écrase les variables ci-dessous
|
||||
nom = local_inscrit_data_retval['apprenant_data']['nom']
|
||||
prenom = local_inscrit_data_retval['apprenant_data']['prenom']
|
||||
email = local_inscrit_data_retval['apprenant_data']['email']
|
||||
# Si on a un dossier apprenant, alors on écrase les variables ci-dessous
|
||||
nom = local_inscrit_data_retval['apprenant_data']['nom']
|
||||
prenom = local_inscrit_data_retval['apprenant_data']['prenom']
|
||||
email = local_inscrit_data_retval['apprenant_data']['email']
|
||||
|
||||
|
||||
user['nom'] = nom
|
||||
|
|
@ -6179,7 +6262,7 @@ Cette fonction met à jour la decision du jury pour
|
|||
un inscrit (jury_cac)
|
||||
"""
|
||||
|
||||
def Add_Update_Inscrit_Juy_Promo_Decision(diction):
|
||||
def Add_Update_Inscrit_Jury_Promo_Decision(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
|
|
@ -6281,9 +6364,97 @@ def Add_Update_Inscrit_Juy_Promo_Decision(diction):
|
|||
return False, " Impossible de mettre à jour la décision du jury "
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Cette fonction met à jour la decision du jury d'admission (session admission)
|
||||
"""
|
||||
|
||||
def Add_Update_Candidat_Jury_Admission_Decision(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'tab_ids', 'jury_observation', 'jury_note', 'jury_validation']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list and val.startswith('my_') is False:
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le champ '" + val + "' n'est pas autorisé")
|
||||
return False, " Les informations fournies sont incorrectes"
|
||||
|
||||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', 'tab_ids', 'jury_observation', 'jury_note', 'jury_validation']
|
||||
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - La valeur '" + val + "' n'est pas presente dans la liste des arguments ")
|
||||
return False, " Les informations fournies sont incorrectes"
|
||||
|
||||
"""
|
||||
Verification de l'identité et autorisation de l'entité qui
|
||||
appelle cette API
|
||||
"""
|
||||
token = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
token = diction['token']
|
||||
|
||||
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
tab_ids = ""
|
||||
tab_ids = []
|
||||
tab_ids_ObjectId = []
|
||||
|
||||
if ("tab_ids" in diction.keys()):
|
||||
if diction['tab_ids']:
|
||||
tab_ids = diction['tab_ids']
|
||||
|
||||
|
||||
tab_ids_splited = str(tab_ids).split(",")
|
||||
|
||||
|
||||
# Controle de validité des inscriptions
|
||||
for my_session_formation_final_note_classement in tab_ids_splited:
|
||||
if( my_session_formation_final_note_classement):
|
||||
tab_ids_ObjectId.append(ObjectId(str(my_session_formation_final_note_classement)))
|
||||
|
||||
|
||||
|
||||
update_data = {}
|
||||
update_data['date_update'] = str(datetime.now())
|
||||
update_data['update_by'] = str(my_partner['_id'])
|
||||
update_data['jury_observation'] = str(diction['jury_observation'])
|
||||
update_data['jury_note'] = str(diction['jury_note'])
|
||||
update_data['jury_validation'] = str(diction['jury_validation'])
|
||||
|
||||
MYSY_GV.dbname['jury_apprenant'].update_many({'_id': {'$in' : tab_ids_ObjectId},
|
||||
'valide': '1',
|
||||
'partner_owner_recid': str(my_partner['recid']),
|
||||
},
|
||||
{'$set': update_data}
|
||||
)
|
||||
|
||||
return True, " La décision du jury été correctement mise à jour"
|
||||
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible de mettre à jour la décision du jury "
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Cette fonction met à jour les observation du jury sur les notes UE
|
||||
|
||||
collection : session_formation_final_note_classement
|
||||
"""
|
||||
def Add_Update_UE_Jury_Observation(diction):
|
||||
|
|
|
|||
536
main.py
536
main.py
|
|
@ -102,6 +102,8 @@ import groupe_client_mgt as groupe_client_mgt
|
|||
import email_queu.email_queu_mgt as email_queu_mgt
|
||||
import internal_email_mgt as internal_email_mgt
|
||||
import ent_alert_messages as ent_alert_messages
|
||||
import admission_mgt as admission_mgt
|
||||
import session_admission_fi as session_admission_fi
|
||||
|
||||
import base_document_automatic_setup as base_document_automatic_setup
|
||||
|
||||
|
|
@ -7560,6 +7562,25 @@ def Get_List_object_owner_collection_Stored_Files_With_Filter_No_Token():
|
|||
|
||||
|
||||
|
||||
"""
|
||||
API permet de donner un statut d'acceptation ou non du document
|
||||
Ceci est par exemple utilisé dans le cas de procedures de candidature ou
|
||||
un candidat peut envoyer un document qui peut etre accepté ou rejeté
|
||||
"""
|
||||
@app.route('/myclass/api/Acceptance_Stored_Downloaded_File_From_Id/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Acceptance_Stored_Downloaded_File_From_Id():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Acceptance_Stored_Downloaded_File_From_Id : payload = ", payload)
|
||||
status, retval = attached_file_mgt.Acceptance_Stored_Downloaded_File_From_Id(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API de suppression d'un fichier stocké
|
||||
|
|
@ -8775,7 +8796,7 @@ API pour enregister ou mettre à jour une image d'un apprenant
|
|||
def Add_Update_Apprenant_Image():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Add_Update_Apprenant_Image : payload = ",payload)
|
||||
print(" ### Add_Update_Apprenant_Image : payload = ")
|
||||
|
||||
if request.method == 'POST':
|
||||
# Create variable for uploaded file
|
||||
|
|
@ -13272,6 +13293,35 @@ def Cron_Daily_Automatic_Qualiopi_Documents_For_Given_Partner():
|
|||
|
||||
|
||||
|
||||
"""
|
||||
API de test du cron qui va traiter automatiquement les documents à envoyer pour un partenaire pour isabelle
|
||||
"""
|
||||
@app.route('/myclass/api/Cron_Daily_Automatic_Qualiopi_Documents_For_Given_Partner_Isabelle/', methods=['POST', 'GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Cron_Daily_Automatic_Qualiopi_Documents_For_Given_Partner_Isabelle():
|
||||
payload = mycommon.strip_dictionary(request.form.to_dict())
|
||||
mycommon.myprint(" ### CRONNN Cron_Daily_Automatic_Qualiopi_Documents_For_Given_Partner_Isabelle : payload = ")
|
||||
print(" ### CRONNN Cron_Daily_Automatic_Qualiopi_Documents_For_Given_Partner_Isabelle : payload = ", payload)
|
||||
status, retval = Job_Cron.Cron_Daily_Automatic_Qualiopi_Documents_For_Given_Partner_Isabelle(payload)
|
||||
print(" FIN traitement Cron_Daily_Automatic_Qualiopi_Documents_For_Given_Partner_Isabelle localStatus = ", status)
|
||||
return jsonify(status=status, message="OK" )
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API de test du cron qui va traiter automatiquement les documents à envoyer pour un partenaire pour cherif
|
||||
"""
|
||||
@app.route('/myclass/api/Cron_Daily_Automatic_Qualiopi_Documents_For_Given_Partner_cherif/', methods=['POST', 'GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Cron_Daily_Automatic_Qualiopi_Documents_For_Given_Partner_cherif():
|
||||
payload = mycommon.strip_dictionary(request.form.to_dict())
|
||||
mycommon.myprint(" ### CRONNN Cron_Daily_Automatic_Qualiopi_Documents_For_Given_Partner_cherif : payload = ")
|
||||
print(" ### CRONNN Cron_Daily_Automatic_Qualiopi_Documents_For_Given_Partner_cherif : payload = ", payload)
|
||||
status, retval = Job_Cron.Cron_Daily_Automatic_Qualiopi_Documents_For_Given_Partner_cherif(payload)
|
||||
print(" FIN traitement Cron_Daily_Automatic_Qualiopi_Documents_For_Given_Partner_cherif localStatus = ", status)
|
||||
return jsonify(status=status, message="OK" )
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
|
|
@ -14114,16 +14164,32 @@ def Send_Jury_Membre_Convocation_By_Email():
|
|||
API pour mettre à jour la decision du jury pour
|
||||
un inscrit (jury_cac)
|
||||
"""
|
||||
@app.route('/myclass/api/Add_Update_Inscrit_Juy_Promo_Decision/', methods=['POST','GET'])
|
||||
@app.route('/myclass/api/Add_Update_Inscrit_Jury_Promo_Decision/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Add_Update_Inscrit_Juy_Promo_Decision():
|
||||
def Add_Update_Inscrit_Jury_Promo_Decision():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Add_Update_Inscrit_Juy_Promo_Decision : payload = ",str(payload))
|
||||
status, retval = jury_mgt.Add_Update_Inscrit_Juy_Promo_Decision( payload)
|
||||
print(" ### Add_Update_Inscrit_Jury_Promo_Decision : payload = ",str(payload))
|
||||
status, retval = jury_mgt.Add_Update_Inscrit_Jury_Promo_Decision( payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour mettre à jour la decision du jury d'admission (session admission)
|
||||
"""
|
||||
@app.route('/myclass/api/Add_Update_Candidat_Jury_Admission_Decision/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Add_Update_Candidat_Jury_Admission_Decision():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Add_Update_Candidat_Jury_Admission_Decision : payload = ",str(payload))
|
||||
status, retval = jury_mgt.Add_Update_Candidat_Jury_Admission_Decision( payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour mettre à jour la decision du jury pour un jury d' UE (pas CAC mais UE)
|
||||
"""
|
||||
|
|
@ -15068,6 +15134,466 @@ def Disable_Session_Formation_Automation():
|
|||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
API pour Creation de la configuration d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Add_Admission_Setup/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Add_Admission_Setup():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Add_Admission_Setup : payload = ",payload)
|
||||
localStatus, message = admission_mgt.Add_Admission_Setup(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
API pour Mise à jour de la configuration d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Update_Admission_Setup/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Update_Admission_Setup():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Update_Admission_Setup : payload = ",payload)
|
||||
localStatus, message = admission_mgt.Update_Admission_Setup(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
API pour Suppression d'une configuration d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Delete_Admission_Setup/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Delete_Admission_Setup():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Delete_Admission_Setup : payload = ",payload)
|
||||
localStatus, message = admission_mgt.Delete_Admission_Setup(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour Recuperer la liste des configuration d'admission d'un partenaire
|
||||
"""
|
||||
@app.route('/myclass/api/Get_List_Admission_Setup/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_List_Admission_Setup():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_List_Admission_Setup : payload = ",payload)
|
||||
localStatus, message = admission_mgt.Get_List_Admission_Setup(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour Recuperer les données d'une configuration d'admission donnée
|
||||
"""
|
||||
@app.route('/myclass/api/Get_List_Admission_Setup/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_Given_Admission_Setup():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_Given_Admission_Setup : payload = ",payload)
|
||||
localStatus, message = admission_mgt.Get_Given_Admission_Setup(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour Ajouter et Update d'une étape à une configuration d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Add_Update_Admission_Setup_Etape/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Add_Update_Admission_Setup_Etape():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Add_Update_Admission_Setup_Etape : payload = ",payload)
|
||||
localStatus, message = admission_mgt.Add_Update_Admission_Setup_Etape(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour Suppression d'une étape à une configuration d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Delete_Admission_Setup_Etape/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Delete_Admission_Setup_Etape():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Delete_Admission_Setup_Etape : payload = ",payload)
|
||||
localStatus, message = admission_mgt.Delete_Admission_Setup_Etape(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
API pour Recuperer la liste des etapes d'une configuration d'admission d'un partenaire
|
||||
"""
|
||||
@app.route('/myclass/api/Get_List_Admission_Setup_Etape/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_List_Admission_Setup_Etape():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_List_Admission_Setup_Etape : payload = ",payload)
|
||||
localStatus, message = admission_mgt.Get_List_Admission_Setup_Etape(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour Recuperer les données d'une etape configuration d'admission donnée
|
||||
"""
|
||||
@app.route('/myclass/api/Get_Given_Admission_Setup_Etape/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_Given_Admission_Setup_Etape():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_Given_Admission_Setup_Etape : payload = ",payload)
|
||||
localStatus, message = admission_mgt.Get_Given_Admission_Setup_Etape(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour Ajouter et Update d'un critère à une configuration d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Add_Update_Admission_Setup_Critere/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Add_Update_Admission_Setup_Critere():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Add_Update_Admission_Setup_Critere : payload = ",payload)
|
||||
localStatus, message = admission_mgt.Add_Update_Admission_Setup_Critere(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
API pour Suppression d'un critère à une configuration d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Delete_Admission_Setup_Critere/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Delete_Admission_Setup_Critere():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Delete_Admission_Setup_Critere : payload = ",payload)
|
||||
localStatus, message = admission_mgt.Delete_Admission_Setup_Critere(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
API pour Recuperer la liste des critères d'une configuration d'admission d'un partenaire
|
||||
"""
|
||||
@app.route('/myclass/api/Get_List_Admission_Setup_Critere/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_List_Admission_Setup_Critere():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_List_Admission_Setup_Critere : payload = ",payload)
|
||||
localStatus, message = admission_mgt.Get_List_Admission_Setup_Critere(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour Recuperer les données d'une etape configuration d'admission donnée
|
||||
"""
|
||||
@app.route('/myclass/api/Get_Given_Admission_Setup_Critere/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_Given_Admission_Setup_Critere():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_Given_Admission_Setup_Critere : payload = ",payload)
|
||||
localStatus, message = admission_mgt.Get_Given_Admission_Setup_Critere(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour Ajouter et Update d'un document à une configuration d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Add_Update_Admission_Setup_Document/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Add_Update_Admission_Setup_Document():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Add_Update_Admission_Setup_Document : payload = ",payload)
|
||||
localStatus, message = admission_mgt.Add_Update_Admission_Setup_Document(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
API pour Suppression d'un document à une configuration d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Delete_Admission_Setup_Document/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Delete_Admission_Setup_Document():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Delete_Admission_Setup_Document : payload = ",payload)
|
||||
localStatus, message = admission_mgt.Delete_Admission_Setup_Document(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
API pour Recuperer la liste des documents d'une configuration d'admission d'un partenaire
|
||||
"""
|
||||
@app.route('/myclass/api/Get_List_Admission_Setup_Document/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_List_Admission_Setup_Document():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_List_Admission_Setup_Document : payload = ",payload)
|
||||
localStatus, message = admission_mgt.Get_List_Admission_Setup_Document(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour Recuperer les données d'un document configuration d'admission donnée
|
||||
"""
|
||||
@app.route('/myclass/api/Get_Given_Admission_Setup_Document/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_Given_Admission_Setup_Document():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_Given_Admission_Setup_Document : payload = ",payload)
|
||||
localStatus, message = admission_mgt.Get_Given_Admission_Setup_Documents(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour Creation d'une session d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Add_Admission_Session/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Add_Admission_Session():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Add_Admission_Session : payload = ",payload)
|
||||
localStatus, message = session_admission_fi.Add_Admission_Session(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
API pour Mise à jour d'une session d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Update_Admission_Session/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Update_Admission_Session():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Update_Admission_Session : payload = ",payload)
|
||||
localStatus, message = session_admission_fi.Update_Admission_Session(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
API pour Suppression d'une session d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Delete_Admission_Session/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Delete_Admission_Session():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Delete_Admission_Session : payload = ",payload)
|
||||
localStatus, message = session_admission_fi.Delete_Admission_Session(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour Recuperer la liste des session d'admission d'un partenaire
|
||||
"""
|
||||
@app.route('/myclass/api/Get_List_Admission_Session/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_List_Admission_Session():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_List_Admission_Session : payload = ",payload)
|
||||
localStatus, message = session_admission_fi.Get_List_Admission_Session(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
API pour Recuperer les données d'une session d'admission donnée
|
||||
"""
|
||||
@app.route('/myclass/api/Get_Given_Admission_Session/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_Given_Admission_Session():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_Given_Admission_Session : payload = ",payload)
|
||||
localStatus, message = session_admission_fi.Get_Given_Admission_Session(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
API pour Inscrire une personne à une session d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Add_Stagiaire_To_Admission_Session/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Add_Stagiaire_To_Admission_Session():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Add_Stagiaire_To_Admission_Session : payload = ",payload)
|
||||
localStatus, message = session_admission_fi.Add_Stagiaire_To_Admission_Session(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
API pour Mettre à jour une personne à une session d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Update_Stagiaire_To_Admission_Session/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Update_Stagiaire_To_Admission_Session():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Update_Stagiaire_To_Admission_Session : payload = ",payload)
|
||||
localStatus, message = session_admission_fi.Update_Stagiaire_To_Admission_Session(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
API pour Mettre à jour une personne à une session d'admission JUSTE l'ETAPE DE LA SESSION d'ADMISSION
|
||||
"""
|
||||
@app.route('/myclass/api/Update_Stagiaire_Only_Status_Admission_Session/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Update_Stagiaire_Only_Status_Admission_Session():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Update_Stagiaire_Only_Status_Admission_Session : payload = ",payload)
|
||||
localStatus, message = session_admission_fi.Update_Stagiaire_Only_Status_Admission_Session(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour Suppression de l'inscription d'une personne à une session d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Delete_Stagiaire_To_Admission_Session/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Delete_Stagiaire_To_Admission_Session():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Delete_Stagiaire_To_Admission_Session : payload = ",payload)
|
||||
localStatus, message = session_admission_fi.Delete_Stagiaire_To_Admission_Session(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour Recuperer la liste des personne à une session d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Get_List_Stagiaire_Admission_Session/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_List_Stagiaire_Admission_Session():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_List_Stagiaire_Admission_Session : payload = ",payload)
|
||||
localStatus, message = session_admission_fi.Get_List_Stagiaire_Admission_Session(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour Recuperer les données d'une personne inscrite à une session d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Get_Given_Stagiaire_Admission_Session/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_Given_Stagiaire_Admission_Session():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_Given_Stagiaire_Admission_Session : payload = ",payload)
|
||||
localStatus, message = session_admission_fi.Get_Given_Stagiaire_Admission_Session(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
API pour enregister ou mettre à jour une image d'un inscrit à une session d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Add_Update_Inscrit_Admiss_Session_Image/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Add_Update_Inscrit_Admiss_Session_Image():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Add_Update_Inscrit_Admiss_Session_Image : payload = ")
|
||||
|
||||
if request.method == 'POST':
|
||||
# Create variable for uploaded file
|
||||
if ('file_img' in request.files.keys()):
|
||||
file_img = request.files['file_img']
|
||||
else:
|
||||
file_img = None
|
||||
return False, "Aucun fichier image à enregistrer"
|
||||
|
||||
localStatus, message = session_admission_fi.Add_Update_Inscrit_Admiss_Session_Image(file_img, MYSY_GV.upload_folder, payload)
|
||||
return jsonify(status=localStatus, message=message)
|
||||
|
||||
|
||||
"""
|
||||
API pour supprimer l'image d'un inscrit à une session d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Delete_Inscrit_Admiss_Session_Image/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Delete_Inscrit_Admiss_Session_Image():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Delete_Inscrit_Admiss_Session_Image payload = ",payload)
|
||||
status, retval = session_admission_fi.Delete_Inscrit_Admiss_Session_Image(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
"""
|
||||
API pour recuperer l'image d'un inscrit depuis a une session d'admission
|
||||
"""
|
||||
@app.route('/myclass/api/Get_Inscrit_Admiss_Session_Recorded_Image_from_front/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_Inscrit_Admiss_Session_Recorded_Image_from_front():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_Inscrit_Admiss_Session_Recorded_Image_from_front payload = ",payload)
|
||||
status, retval = session_admission_fi.Get_Inscrit_Admiss_Session_Recorded_Image_from_front(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
"""
|
||||
API pour Recuperer les document fournis par un candidat dans le cadre d'un process d'inscription
|
||||
"""
|
||||
@app.route('/myclass/api/Get_List_Candidat_Document/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_List_Candidat_Document():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_List_Candidat_Document payload = ",payload)
|
||||
status, retval = session_admission_fi.Get_List_Candidat_Document(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour Recuperer la completude des pièce jointe jointe d'un candidat
|
||||
% de pièce validé
|
||||
"""
|
||||
@app.route('/myclass/api/Get_Pourcentage_Candidat_Document/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_Pourcentage_Candidat_Document():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_Pourcentage_Candidat_Document payload = ",payload)
|
||||
status, retval = session_admission_fi.Get_Pourcentage_Candidat_Document(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(" debut api")
|
||||
|
|
|
|||
|
|
@ -904,7 +904,7 @@ Cette fonction verifie si une valeur est bien un 'ObjectId' valide
|
|||
def IsObjectId(oid):
|
||||
try:
|
||||
ObjectId(oid)
|
||||
print(" IsObjectId "+str(oid)+" est valde")
|
||||
#print(" IsObjectId "+str(oid)+" est valde")
|
||||
return True
|
||||
except ValueError:
|
||||
return False
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue