Commit e3c8ff9e authored by PabloLeCrapaud's avatar PabloLeCrapaud
Browse files

Merge branch 'iut-dev' into Mediatheque

parents dac7b372 94710eab
......@@ -168,17 +168,20 @@ class MinHalfDaysHelperTutor(MinHalfDaysHelperBase):
for d in self.ttmodel.wdb.days:
for c in courses:
sl8h = min(self.ttmodel.wdb.slots_by_half_day[d,Time.AM] & self.ttmodel.wdb.compatible_slots[c])
sl11h = max(self.ttmodel.wdb.slots_by_half_day[d,Time.AM] & self.ttmodel.wdb.compatible_slots[c])
sl14h = min(self.ttmodel.wdb.slots_by_half_day[d,Time.PM] & self.ttmodel.wdb.compatible_slots[c])
sl17h = max(self.ttmodel.wdb.slots_by_half_day[d,Time.PM] & self.ttmodel.wdb.compatible_slots[c])
for c2 in courses.exclude(id=c.id):
sl11h = max(
self.ttmodel.wdb.slots_by_half_day[d, Time.AM] & self.ttmodel.wdb.compatible_slots[c2])
sl17h = max(
self.ttmodel.wdb.slots_by_half_day[d, Time.PM] & self.ttmodel.wdb.compatible_slots[c2])
if self.constraint.weight:
conj_var_AM = self.ttmodel.add_conjunct(self.ttmodel.TT[(sl8h, c)],
self.ttmodel.TT[(sl11h, c2)])
self.ttmodel.TT[(sl11h, c2)])
conj_var_PM = self.ttmodel.add_conjunct(self.ttmodel.TT[(sl14h, c)],
self.ttmodel.TT[(sl17h, c2)])
self.ttmodel.TT[(sl17h, c2)])
self.ttmodel.add_to_inst_cost(self.tutor,
self.constraint.local_weight() * self.ponderation * (conj_var_AM + conj_var_PM)/2)
self.constraint.local_weight() * self.ponderation *
(conj_var_AM + conj_var_PM)/2)
else:
self.ttmodel.add_constraint(
self.ttmodel.TT[(sl8h, c)] + self.ttmodel.TT[(sl11h, c2)],
......
......@@ -27,7 +27,7 @@
import datetime
from base.models import TimeGeneralSettings
annee_courante = 2018
annee_courante = 2019
week_ref_days = ['m', 'tu', 'w', 'th', 'f', 'sa', 'su']
week_display_days = ['Lun.', 'Mar.', 'Mer.', 'Jeu.', 'Ven.', 'Sam.', 'Dim.']
......
......@@ -123,7 +123,7 @@ def fill_default_user_preferences(user, dept=None):
dept = Department.objects.first()
if dept is not None:
try:
settings = TimeGeneralSettings.objects.get()
settings = TimeGeneralSettings.objects.get(department=dept)
dst = settings.day_start_time
lst = settings.lunch_break_start_time
lft = settings.lunch_break_finish_time
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment