parent
23ee599c41
commit
4fb7d85cbd
|
@ -4,19 +4,15 @@
|
|||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="qsd">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="19/06/2025 -18h">
|
||||
<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$/Job_Cron_Common.py" beforeDir="false" afterPath="$PROJECT_DIR$/Job_Cron_Common.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$/base_class_calcul_note.py" beforeDir="false" afterPath="$PROJECT_DIR$/base_class_calcul_note.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/notes_apprenant_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/notes_apprenant_mgt.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$/wrapper.py" beforeDir="false" afterPath="$PROJECT_DIR$/wrapper.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$/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" />
|
||||
|
@ -458,7 +454,7 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1747251650255</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="476" />
|
||||
<option name="localTasksCounter" value="477" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -500,7 +496,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="25/04/2025 - 15h" />
|
||||
<MESSAGE value="30/04/2025 - 15h" />
|
||||
<MESSAGE value="02/05/2025 - 20h" />
|
||||
<MESSAGE value="03/05/2025 - 20h" />
|
||||
|
@ -525,6 +520,7 @@
|
|||
<MESSAGE value="09/06/2025 - 21h30" />
|
||||
<MESSAGE value="11/06/2025 - 16h30" />
|
||||
<MESSAGE value="qsd" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="qsd" />
|
||||
<MESSAGE value="19/06/2025 -18h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="19/06/2025 -18h" />
|
||||
</component>
|
||||
</project>
|
203
Job_Cron.py
203
Job_Cron.py
|
@ -1840,4 +1840,205 @@ def Cron_Session_Convocation_Sending(diction):
|
|||
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 d'envoyer les convocations (CRON) "
|
||||
return False, " Impossible d'envoyer les convocations (CRON) "
|
||||
|
||||
|
||||
"""
|
||||
CRON :
|
||||
Cette fonction permet de faire la relance des questionnaires de positionnement
|
||||
"""
|
||||
|
||||
def Cron_Survey_Questionnaires_Relance():
|
||||
try:
|
||||
|
||||
print(" Cron : In function = Cron_Survey_Q_Position_Relance")
|
||||
todays_date = str(date.today().strftime("%d/%m/%Y"))
|
||||
todays_date_ISODATE = datetime.strptime(str(todays_date), '%d/%m/%Y')
|
||||
|
||||
|
||||
|
||||
|
||||
for relance_setp in MYSY_GV.dbname['base_partner_setup'].find({'valide': '1',
|
||||
'locked': '0',
|
||||
'config_name': 'relance_auto',
|
||||
'config_value': '1',
|
||||
'related_collection': 'survey',
|
||||
'partner_owner_recid': {'$ne': 'default'},
|
||||
|
||||
}):
|
||||
nb_limite_relance = 0
|
||||
nb_relance_data = MYSY_GV.dbname['base_partner_setup'].find_one({'valide': '1',
|
||||
'locked': '0',
|
||||
'config_name': 'nb_relance_auto',
|
||||
'related_collection': 'survey',
|
||||
'partner_owner_recid': str(relance_setp['partner_owner_recid']),
|
||||
})
|
||||
|
||||
if("config_value" in nb_relance_data.keys() and nb_relance_data['config_value']):
|
||||
nb_limite_relance = mycommon.tryInt(str(nb_relance_data['config_value']))
|
||||
|
||||
frequence_relance_auto = 0
|
||||
frequence_relance_data = MYSY_GV.dbname['base_partner_setup'].find_one({'valide': '1',
|
||||
'locked': '0',
|
||||
'config_name': 'frequence_relance_auto',
|
||||
'related_collection': 'survey',
|
||||
'partner_owner_recid': str(
|
||||
relance_setp['partner_owner_recid']),
|
||||
})
|
||||
|
||||
if ("config_value" in frequence_relance_data.keys() and frequence_relance_data['config_value']):
|
||||
frequence_relance_auto = mycommon.tryInt(str(frequence_relance_data['config_value']))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ("partner_owner_recid" in relance_setp.keys() and relance_setp['partner_owner_recid']):
|
||||
local_partner_owner_recid = str(relance_setp['partner_owner_recid'])
|
||||
|
||||
# Aller chercher tous les questionnaires à relancer
|
||||
devis_qery_match = {'$and': [{'partner_owner_recid': str(local_partner_owner_recid),
|
||||
'valide': '1',
|
||||
'locked': '0', 'statut': '1', 'type': '1',
|
||||
},
|
||||
]}
|
||||
|
||||
pipe_qry = ([
|
||||
|
||||
{'$match': devis_qery_match},
|
||||
])
|
||||
|
||||
print(" ## pipe_qry Cron_Survey_Questionnaires_Relance = ", pipe_qry)
|
||||
for local_questionnaire in MYSY_GV.dbname['survey'].aggregate(pipe_qry):
|
||||
|
||||
print("### local_questionnaire a traiter = ", local_questionnaire)
|
||||
|
||||
relance_done = 0
|
||||
|
||||
if ("nb_relance" in local_questionnaire.keys() and local_questionnaire['nb_relance']):
|
||||
relance_done = mycommon.tryInt(str(local_questionnaire['nb_relance']))
|
||||
|
||||
|
||||
date_derniere_relance_auto = "01/12/2099"
|
||||
if ("date_dernier_relance_auto" in local_questionnaire.keys() and local_questionnaire['date_dernier_relance_auto']):
|
||||
date_derniere_relance_auto = str(local_questionnaire['date_dernier_relance_auto'])[0:10]
|
||||
|
||||
date_derniere_relance_auto_ISODATE = datetime.strptime(str(date_derniere_relance_auto), '%d/%m/%Y')
|
||||
|
||||
new_relance_date_ISODATE = date_derniere_relance_auto_ISODATE + timedelta(
|
||||
days=frequence_relance_auto)
|
||||
|
||||
|
||||
print(" ### LA frequence_relance_auto ", frequence_relance_auto)
|
||||
|
||||
print(" ### LA dernière relance date de ", date_derniere_relance_auto)
|
||||
|
||||
print(" ### LA PROCHAINE RELANCE EST ", new_relance_date_ISODATE)
|
||||
|
||||
|
||||
new_relance_date_no_ISODATE = str(new_relance_date_ISODATE.strftime("%d/%m/%Y"))
|
||||
# print(" ### LA PROCHAINE RELANCE EST (new_relance_date_no_ISODATE) ", new_relance_date_no_ISODATE)
|
||||
|
||||
datetime.strptime(str(todays_date), '%d/%m/%Y')
|
||||
|
||||
|
||||
print(" ### relance_done = ",relance_done)
|
||||
print(" ### nb_limite_relance = ", nb_limite_relance)
|
||||
|
||||
print(" ### datetime.strptime( str(todays_date), '%d/%m/%Y') = ", datetime.strptime(
|
||||
str(todays_date), '%d/%m/%Y'))
|
||||
|
||||
print(" ### datetime.strptime(str(new_relance_date_no_ISODATE).strip(), '%d/%m/%Y') = ", datetime.strptime(str(new_relance_date_no_ISODATE).strip(),
|
||||
'%d/%m/%Y'))
|
||||
|
||||
if ( relance_done <= nb_limite_relance and datetime.strptime(
|
||||
str(todays_date), '%d/%m/%Y') >= datetime.strptime(str(new_relance_date_no_ISODATE).strip(),
|
||||
'%d/%m/%Y')):
|
||||
|
||||
"""
|
||||
On fait le traitement, on envoie le mail
|
||||
1 - recuperation des data
|
||||
"""
|
||||
|
||||
local_status, my_partner = mycommon.Get_Connected_User_Partner_Data_From_RecID(
|
||||
str(local_questionnaire['partner_owner_recid']))
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
local_dicton = {}
|
||||
local_dicton['partner_owner_recid'] = str(local_questionnaire['partner_owner_recid'])
|
||||
local_dicton['tab_ids'] = str(local_questionnaire['_id'])
|
||||
|
||||
print(" ### local_dicton = ", local_dicton)
|
||||
|
||||
"""
|
||||
ICICI : comme j'ai supprimé de formation et des session, m'assurer d'avoir de bonnes date
|
||||
"""
|
||||
local_status, local_retval = survey_mgt.Automatic_Send_Survey_TabIds(local_dicton)
|
||||
|
||||
print(" relance return local_send_remind_status = ", local_status)
|
||||
|
||||
if (local_status is True):
|
||||
|
||||
print(" RELANCE FAIT ET OK ")
|
||||
"""
|
||||
Une fois la relance faite, on met à jour le devis avec les infos suivant :
|
||||
- liste_relance
|
||||
|
||||
"""
|
||||
|
||||
frequence_relance_auto_reached = "0"
|
||||
|
||||
if ("list_relance" in local_questionnaire.keys() and local_questionnaire['list_relance']):
|
||||
local_node = {}
|
||||
local_node['date_relance'] = str(date.today())
|
||||
local_node['mesg_relance'] = str(local_retval)
|
||||
local_questionnaire['list_relance'].append(local_node)
|
||||
|
||||
else:
|
||||
|
||||
local_node = {}
|
||||
local_node['date_relance'] = str(date.today())
|
||||
local_questionnaire['list_relance'] = []
|
||||
local_questionnaire['list_relance'].append(local_node)
|
||||
local_node['mesg_relance'] = str(local_retval)
|
||||
|
||||
nb_relance = str(len(local_questionnaire['list_relance']))
|
||||
|
||||
local_data_update = local_questionnaire
|
||||
|
||||
id_to_update = str(local_data_update['_id'])
|
||||
|
||||
del local_data_update['_id']
|
||||
|
||||
local_data_update['nb_relance'] = str(nb_relance)
|
||||
local_data_update['date_dernier_relance_auto'] = str(todays_date)
|
||||
|
||||
result = MYSY_GV.dbname['survey'].find_one_and_update(
|
||||
{'_id': ObjectId(str(id_to_update)),
|
||||
|
||||
'valide': '1',
|
||||
'locked': '0'},
|
||||
{"$set": local_data_update},
|
||||
upsert=False,
|
||||
return_document=ReturnDocument.AFTER
|
||||
)
|
||||
|
||||
|
||||
else:
|
||||
print(" ### NoNNNNNNNNNN on NEEEE fait la relanceeeeeeeeeeeee")
|
||||
print(" limite relance atteint : ")
|
||||
print(" limite relance_done : ", relance_done)
|
||||
print(" limite nb_limite_relance : ", nb_limite_relance)
|
||||
|
||||
|
||||
return True, "Relance Questionnaires 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)
|
||||
|
||||
|
|
|
@ -1361,11 +1361,11 @@ def Cron_Create_One_Survey_To_Inscrit(diction):
|
|||
|
||||
new_survey_data['statut'] = "0"
|
||||
new_survey_data['type'] = "1"
|
||||
new_survey_data['date_update'] = str(datetime.now())
|
||||
new_survey_data['creation_date'] = str(datetime.now())
|
||||
new_survey_data['update_by'] = str(my_partner['_id'])
|
||||
new_survey_data['creation_by'] = str(my_partner['_id'])
|
||||
new_survey_data['date_dernier_relance_auto'] = str(datetime.now().strftime("%d/%m/%Y"))
|
||||
|
||||
print(" ~~~~ A inserer = new_survey_data = ", new_survey_data)
|
||||
inserted_id = MYSY_GV.dbname['survey'].insert_one(new_survey_data).inserted_id
|
||||
|
||||
if (not inserted_id):
|
||||
|
@ -3002,3 +3002,5 @@ def Cron_Send_Emargement_By_Date_By_Email_for_not_sent(Folder, diction):
|
|||
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 d'envoyer les demandes d'émargement ", "0"
|
||||
|
||||
|
||||
|
|
1858
Log/log_file.log
1858
Log/log_file.log
File diff suppressed because it is too large
Load Diff
|
@ -613,7 +613,6 @@ def Add_Update_SessionFormation(diction):
|
|||
|
||||
return True, " La promotion de formation à bien été mise à jour"
|
||||
|
||||
print(" ### GRRR str(session_id) = ", str(session_id))
|
||||
if (len(str(session_id)) <= 0):
|
||||
# La promotion n'existe pas, on fait une simple creation
|
||||
|
||||
|
@ -644,7 +643,7 @@ def Add_Update_SessionFormation(diction):
|
|||
|
||||
mydata['automatic_traitement'].append(new_local_data)
|
||||
|
||||
print(" ### mydata ICIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII = ", mydata)
|
||||
|
||||
coll_name = MYSY_GV.dbname['session_formation']
|
||||
ret_val = coll_name.insert_one(mydata)
|
||||
|
||||
|
|
14
main.py
14
main.py
|
@ -10453,6 +10453,20 @@ def Internal_Global_MySy_Cron_Traitement():
|
|||
|
||||
|
||||
|
||||
""""
|
||||
Test cron qui fait les relance des questionnaire non repondu (position, eval, etc)
|
||||
"""
|
||||
@app.route('/myclass/api/Cron_Survey_Questionnaires_Relance/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Cron_Survey_Questionnaires_Relance():
|
||||
mycommon.myprint(" ### CRONNN Cron_Survey_Questionnaires_Relance : payload = ")
|
||||
print(" ### CRONNN Cron_Survey_Questionnaires_Relance : payload = ")
|
||||
status, retval = Job_Cron.Cron_Survey_Questionnaires_Relance()
|
||||
print(" FIN traitement Cron_Survey_Questionnaires_Relance localStatus = ", status)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour ajouter un type d'evaluation
|
||||
"""
|
||||
|
|
|
@ -71,7 +71,7 @@ def Add_Update_Partner_Basic_Setup(diction):
|
|||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'config_name', 'config_value', 'related_collection']
|
||||
field_list = ['token', 'config_name', 'config_value', 'related_collection', 'config_id']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
@ -83,7 +83,7 @@ def Add_Update_Partner_Basic_Setup(diction):
|
|||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', 'config_name', 'config_value', 'related_collection']
|
||||
field_list_obligatoire = ['token', 'config_name', 'config_value', 'related_collection', 'config_id']
|
||||
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
|
@ -119,23 +119,33 @@ def Add_Update_Partner_Basic_Setup(diction):
|
|||
my_data['locked'] = "0"
|
||||
my_data['date_update'] = str(datetime.now())
|
||||
|
||||
# La clé de la mise à jour est :
|
||||
# my_data['partner_owner_recid']
|
||||
# my_data['config_name']
|
||||
if( 'config_id' in diction.keys() and diction['config_id']):
|
||||
config_id_count = MYSY_GV.dbname['base_partner_setup'].count_documents({'_id':ObjectId(str(diction['config_id'])),
|
||||
'partner_owner_recid':str(my_partner['recid']),
|
||||
'valide':'1',
|
||||
'locked':'0'})
|
||||
|
||||
result = MYSY_GV.dbname['base_partner_setup'].find_one_and_update(
|
||||
{'partner_owner_recid': str(my_partner['recid']),
|
||||
'config_name' : str(diction['config_name']),
|
||||
'related_collection':str(diction['related_collection'])},
|
||||
{"$set": my_data},
|
||||
return_document=ReturnDocument.AFTER,
|
||||
upsert=True,
|
||||
if (config_id_count != 1):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + "L'identifiant du point de configuration est invalide ")
|
||||
return False, "L'identifiant du point de configuration est invalide "
|
||||
|
||||
)
|
||||
|
||||
result = MYSY_GV.dbname['base_partner_setup'].find_one_and_update(
|
||||
{'partner_owner_recid': str(my_partner['recid']),
|
||||
'config_name': str(diction['config_name']),
|
||||
'related_collection': str(diction['related_collection'])},
|
||||
{"$set": my_data},
|
||||
return_document=ReturnDocument.AFTER,
|
||||
upsert=False,
|
||||
)
|
||||
|
||||
else:
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + "L'identifiant du point de configuration est invalide (2) ")
|
||||
return False, "L'identifiant du point de configuration est invalide (2) "
|
||||
|
||||
|
||||
|
||||
return True, " La configuration a été correctement ajoutée / Mise à jour"
|
||||
return True, " La configuration a été correctement mise à jour"
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
|
@ -232,7 +242,7 @@ def Get_List_Partner_Basic_Setup(diction):
|
|||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'related_collection']
|
||||
field_list = ['token', 'tab_related_collection']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
@ -244,7 +254,7 @@ def Get_List_Partner_Basic_Setup(diction):
|
|||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', 'related_collection']
|
||||
field_list_obligatoire = ['token', 'tab_related_collection']
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(
|
||||
|
@ -267,11 +277,21 @@ def Get_List_Partner_Basic_Setup(diction):
|
|||
RetObject = []
|
||||
val_tmp = 1
|
||||
|
||||
tab_related_collection_work = str(diction['tab_related_collection']).split(",")
|
||||
tab_related_collection = []
|
||||
for tmp in tab_related_collection_work :
|
||||
if( tmp ):
|
||||
tab_related_collection.append(str(tmp).strip())
|
||||
|
||||
filt_related_collection = {}
|
||||
filt_related_collection['related_collection'] = {'$in':tab_related_collection}
|
||||
|
||||
qry = {'partner_owner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0','related_collection':''}
|
||||
if(len(tab_related_collection) > 0 ):
|
||||
qry = {'$and': [{'partner_owner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0',}, filt_related_collection]}
|
||||
|
||||
|
||||
|
||||
for New_retVal in MYSY_GV.dbname['base_partner_setup'].find({'partner_owner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0',
|
||||
'related_collection':str(diction['related_collection'])}):
|
||||
for New_retVal in MYSY_GV.dbname['base_partner_setup'].find(qry ):
|
||||
if( str(New_retVal['config_name']) == "smtp_user_pwd"):
|
||||
New_retVal['config_value'] = New_retVal['config_value'][:2]+"...."+str(New_retVal['config_value'])[-2:]
|
||||
|
||||
|
|
|
@ -1209,10 +1209,12 @@ def Create_One_Survey_To_Inscrit(diction):
|
|||
|
||||
new_survey_data['statut'] = "0"
|
||||
new_survey_data['type'] = "1"
|
||||
new_survey_data['date_update'] = str(datetime.now())
|
||||
new_survey_data['creation_date'] = str(datetime.now())
|
||||
new_survey_data['update_by'] = str(my_partner['_id'])
|
||||
new_survey_data['creation_by'] = str(my_partner['_id'])
|
||||
|
||||
new_survey_data['date_dernier_relance_auto'] = str(datetime.now().strftime("%d/%m/%Y"))
|
||||
|
||||
|
||||
inserted_id = MYSY_GV.dbname['survey'].insert_one(new_survey_data).inserted_id
|
||||
|
||||
|
@ -1347,14 +1349,13 @@ def Create_One_Survey_To_Except_Inscrit(diction):
|
|||
|
||||
new_survey_data['statut'] = "0"
|
||||
new_survey_data['type'] = "1"
|
||||
new_survey_data['date_update'] = str(datetime.now())
|
||||
new_survey_data['creation_date'] = str(datetime.now())
|
||||
new_survey_data['update_by'] = str(my_partner['_id'])
|
||||
new_survey_data['creation_by'] = str(my_partner['_id'])
|
||||
new_survey_data['date_dernier_relance_auto'] = str(datetime.now().strftime("%d/%m/%Y"))
|
||||
|
||||
print(" ### new_survey_data = ", new_survey_data)
|
||||
inserted_id = MYSY_GV.dbname['survey'].insert_one(new_survey_data).inserted_id
|
||||
|
||||
print(" ### new_survey_data inserted_id = ", inserted_id)
|
||||
|
||||
if (not inserted_id):
|
||||
mycommon.myprint(" Impossible de créer l'enquete (2) ")
|
||||
|
@ -1930,6 +1931,8 @@ def Automatic_Send_Survey_TabIds(diction):
|
|||
mycommon.myprint(str(inspect.stack()[0][3]) + " Le type d'enquete est invalide ")
|
||||
return False, " Le type d'enquete est invalide "
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Recuperation du modele de courrier (unique) associé à l'envoie des questions de positionnement
|
||||
le principe est de prendre le module du partenaire. si pas de modele du partenaire on
|
||||
|
@ -1971,8 +1974,8 @@ def Automatic_Send_Survey_TabIds(diction):
|
|||
else:
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][
|
||||
3]) + " Aucun modèle de document configuré pour envoyer les demandes pour les questionnaires de positionnement ")
|
||||
return False, " Aucun modèle de document configuré pour envoyer les demandes pour les questionnaires de positionnement "
|
||||
3]) + " Aucun modèle de document configuré pour envoyer les demandes pour les questionnaires ")
|
||||
return False, " Aucun modèle de document configuré pour envoyer les demandes pour les questionnaires "
|
||||
|
||||
if ("contenu_doc" not in courrier_template_data.keys() or str(
|
||||
courrier_template_data['contenu_doc']).strip() == ""):
|
||||
|
@ -1980,6 +1983,11 @@ def Automatic_Send_Survey_TabIds(diction):
|
|||
str(inspect.stack()[0][3]) + " Le modèle de document ne contient pas de valeur 'contenu_doc' ")
|
||||
return False, " Le modèle de document ne contient pas de valeur 'contenu_doc' "
|
||||
|
||||
"""print(" ### courrier_ref_interne = ", courrier_ref_interne)
|
||||
print(" ### local_survey_retval['survey_type'] = ", local_survey_retval['survey_type'])
|
||||
print(" ### courrier_template_data[id]= ", str(courrier_template_data['_id']))"""
|
||||
|
||||
|
||||
contenu_doc_Template = jinja2.Template(str(courrier_template_data['contenu_doc']))
|
||||
# Creation du dictionnaire d'information à utiliser pour la creation du doc
|
||||
convention_dictionnary_data = {}
|
||||
|
@ -1992,7 +2000,6 @@ def Automatic_Send_Survey_TabIds(diction):
|
|||
new_diction['list_stagiaire_id'].append(ObjectId(str( local_survey_retval['inscription_id'])))
|
||||
|
||||
|
||||
|
||||
new_diction['list_session_id'] = []
|
||||
if ("session_id" in local_survey_retval.keys() and local_survey_retval['session_id']):
|
||||
new_diction['list_session_id'].append(ObjectId(str(local_survey_retval['session_id'])))
|
||||
|
|
Loading…
Reference in New Issue