08/01/24 - 17h30

master
cherif 2024-01-08 16:51:56 +01:00
parent c639317f31
commit 12c7b652b0
6 changed files with 2608 additions and 13 deletions

View File

@ -3,8 +3,11 @@
<component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="06/01/24 - 20h30">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Dashbord_queries/inscription_tdb_qries.py" beforeDir="false" afterPath="$PROJECT_DIR$/Dashbord_queries/inscription_tdb_qries.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$/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$/partners.py" beforeDir="false" afterPath="$PROJECT_DIR$/partners.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />

File diff suppressed because one or more lines are too long

View File

@ -199,13 +199,19 @@ def add_class(diction):
if diction['title']:
mydata['title'] = diction['title']
note = "1"
if ("note" in diction.keys()):
if diction['note']:
mydata['note'] = diction['note']
note = diction['note']
mydata['note'] = note
cpf = "0"
if ("cpf" in diction.keys()):
if diction['cpf']:
mydata['cpf'] = diction['cpf']
cpf = diction['cpf']
mydata['cpf'] = diction['cpf']
class_level = "0"
if ("class_level" in diction.keys()):
@ -234,14 +240,16 @@ def add_class(diction):
mydata['formateur_id'] = formateur_id
certif = "0"
if ("certif" in diction.keys()):
if diction['certif']:
mydata['certif'] = diction['certif']
certif = diction['certif']
mydata['certif'] = certif
objectif = ""
if ("objectif" in diction.keys()):
if diction['objectif']:
mydata['objectif'] = diction['objectif']
objectif = diction['objectif']
if (len(mycommon.cleanhtml(diction['objectif'])) > MYSY_GV.CLASS_ZONE_OBJECTIF_LIMIT):
mycommon.myprint(
str(inspect.stack()[0][3]) + " : le champ 'objectif' de la formation " + str(
@ -249,11 +257,12 @@ def add_class(diction):
return False, " le champ 'objectif' de la formation " + str(
mydata['external_code']) + " a plus de " + str(MYSY_GV.CLASS_ZONE_OBJECTIF_LIMIT) + " caractères"
mydata['objectif'] = objectif
programme = ""
if ("programme" in diction.keys()):
if diction['programme']:
mydata['programme'] = diction['programme']
programme = diction['programme']
if(len(mycommon.cleanhtml(diction['programme'])) > MYSY_GV.CLASS_ZONE_PROGRAM_LIMIT ):
mycommon.myprint(
str(inspect.stack()[0][3]) + " : le champ 'Progamme' de La formation " + str(
@ -261,11 +270,14 @@ def add_class(diction):
return False, " le champ 'Progamme' de La formation " + str(
mydata['external_code']) + " a plus de " + str(MYSY_GV.CLASS_ZONE_PROGRAM_LIMIT) + " caractères"
mydata['programme'] = programme
prerequis = ""
if ("prerequis" in diction.keys()):
if diction['prerequis']:
mydata['prerequis'] = diction['prerequis']
prerequis = diction['prerequis']
mydata['prerequis'] = prerequis
if ("description" in diction.keys()):
if diction['description']:
@ -387,7 +399,8 @@ def add_class(diction):
return False, " l'url de l'image de la formation " + str(mydata['external_code']) + " est incorrecte "
mydata['img_url'] = diction['img_url']
else:
mydata['img_url'] = ""
if ("duration_unit" in diction.keys()):

View File

@ -1740,7 +1740,7 @@ Cette API de Recuperation d'une image de profils d'une formation pour le mode no
def getRecodedClassImage_from_front():
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### payload = ",payload)
print(" ### getRecodedClassImage_from_front payload = ",payload)
status, myimg= mycommon.getRecodedClassImage_from_front(payload)
return jsonify(status=status, message=myimg)

View File

@ -1582,3 +1582,6 @@ def UpgradetoPro(diction):
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 de migrer vers le compte pro"

View File

@ -45,6 +45,7 @@ import mariadb
from datetime import timedelta
import Collection_Historique as Collection_Historique
import partner_client
import partners
class JSONEncoder(json.JSONEncoder):
@ -4266,7 +4267,7 @@ Cette fonction retour un json de ce type :
convention_dictionnary_data =
{
{'connected_user_data':{'email':'toto@.fr', 'contact_nom':'balde'}}
{'company_data':{'num_nda':'1234', 'website':'www.ssds.fr'}
{'company_data':{'num_nda':'1234', 'website':'www.ssds.fr', 'logo':'mylogo', 'cachet':'my_cache'}
{'class_data':{....}}
{'list_session_data':{....}}
{'list_stagiaire_data':[{...}]}
@ -4359,6 +4360,27 @@ def Get_Dictionnary_data_For_Template(diction):
new_field = {new_champ_name: ""}
company_data.update(new_field)
# Recuperation du logo et du cachet de la société si il y en a
local_part_status, local_part_imgs = partners.getRecodedParnterImage_from_front({'token':str(diction['token'])})
if(local_part_status is False ):
myprint(str(inspect.stack()[0][3]) + " WARNING : Impossible de récuperer le logo et le cachet du partenaire ")
new_field_logo = {'societe_logo':''}
new_field_cachet = {'societe_cachet': ''}
company_data.update(new_field_logo)
company_data.update(new_field_cachet)
else:
print(" ### local_part_imgs = ", local_part_imgs)
print(" ### local_part_imgs[0] = ", local_part_imgs[0])
local_JSON = ast.literal_eval(local_part_imgs[0])
print(" ### local_JSON = ", local_JSON)
new_field_logo = {'societe_logo': "data:image/png;base64,"+local_JSON['logo_img']}
new_field_cachet = {'societe_cachet': "data:image/png;base64,"+local_JSON['cachet_img']}
company_data.update(new_field_logo)
company_data.update(new_field_cachet)
dictionnary_data['company_data'] = company_data
"""