[Scodoc-devel] [SVN] Scolar : [1504] Fix

eviennet at lipn.univ-paris13.fr eviennet at lipn.univ-paris13.fr
Mer 3 Fév 07:37:42 CET 2016


Une pièce jointe HTML a été nettoyée...
URL: <https://www-rt.iutv.univ-paris13.fr/pipermail/scodoc-devel/attachments/20160203/2ab7f4d7/attachment.html>
-------------- section suivante --------------
Modified: branches/ScoDoc7/notes_table.py
===================================================================
--- branches/ScoDoc7/notes_table.py	2016-02-02 21:24:11 UTC (rev 1503)
+++ branches/ScoDoc7/notes_table.py	2016-02-03 06:37:42 UTC (rev 1504)
@@ -41,7 +41,7 @@
 from sco_parcours_dut import list_formsemestre_utilisateurs_uecap
 import sco_parcours_dut 
 import sco_formsemestre
-from sco_formsemestre_edit import formsemestre_uecoef_list
+from sco_formsemestre_edit import formsemestre_uecoef_list, formsemestre_uecoef_create
 import sco_compute_moy
 from sco_formulas import NoteVector
 
@@ -841,8 +841,20 @@
             if sco_codes_parcours.code_ue_validant(code):
                 ue = self.uedict.get(ue_id, None)
                 if ue is None: # not in list for this sem ??? (probably an error)
-                    log('Warning: %s capitalized an UE %s which is not part of current sem %s' % (etudid, ue_id, self.formsemestre_id))
+                    log('Warning: %s capitalized an UE %s which is not part of current sem %s' % (etudid, ue_id, self.formsemestre_id))                    
                     ue = self.context.do_ue_list(args={'ue_id' : ue_id})[0]
+                    self.uedict[ue_id] = ue # record this UE
+                    if ue_id not in self._uecoef:
+                        cl = formsemestre_uecoef_list(
+                            cnx, args={'formsemestre_id' : self.formsemestre_id, 'ue_id' : ue_id })
+                        if not cl:
+                            # cas anormal: UE capitalisee, pas dans ce semestre, et sans coef
+                            log('Warning: setting UE coef to zero')
+                            formsemestre_uecoef_create(
+                                cnx, 
+                                args={'formsemestre_id' : self.formsemestre_id, 'ue_id' : ue_id,
+                                      'coefficient' : 0})
+                        
                 ects = ue['ects'] or 0. # 0 if None
             
             decisions_jury_ues[etudid][ue_id] = {


Plus d'informations sur la liste de diffusion Scodoc-devel