Révision afec7520
Ajouté par Serghei Mihai (congés, retour 15/05) il y a plus de 9 ans
calebasse/agenda/views.py | ||
---|---|---|
433 | 433 |
|
434 | 434 |
def get_context_data(self, **kwargs): |
435 | 435 |
context = super(AgendasTherapeutesView, self).get_context_data(**kwargs) |
436 |
current_service_only = settings.CURRENT_SERVICE_EVENTS_ONLY |
|
436 | 437 |
|
437 | 438 |
time_tables = TimeTable.objects.select_related('worker'). \ |
438 | 439 |
filter(services=self.service). \ |
... | ... | |
444 | 445 |
.select_related() |
445 | 446 |
events = Event.objects.for_today(self.date) \ |
446 | 447 |
.exclude(event_type_id=1) \ |
447 |
.filter(services=self.service) \ |
|
448 | 448 |
.order_by('start_datetime') \ |
449 | 449 |
.select_related() \ |
450 | 450 |
.prefetch_related('services', |
451 | 451 |
'exceptions', |
452 | 452 |
'participants') |
453 | 453 |
eventswithact = EventWithAct.objects.for_today(self.date) \ |
454 |
.filter(services=self.service) \ |
|
455 | 454 |
.order_by('start_datetime') \ |
456 | 455 |
.select_related() \ |
457 | 456 |
.prefetch_related( |
... | ... | |
460 | 459 |
'act_set__actvalidationstate_set', |
461 | 460 |
'exceptions', 'participants') |
462 | 461 |
|
463 |
context['CURRENT_SERVICE_EVENTS_ONLY'] = settings.CURRENT_SERVICE_EVENTS_ONLY |
|
462 |
if current_service_only: |
|
463 |
events = events.filter(services=self.service) |
|
464 |
eventswithact = eventswithact.filter(services=self.service) |
|
465 |
|
|
466 |
context['CURRENT_SERVICE_EVENTS_ONLY'] = current_service_only |
|
464 | 467 |
|
465 | 468 |
events = [ e.today_occurrence(self.date) for e in events ] \ |
466 | 469 |
+ [ e.today_occurrence(self.date) for e in eventswithact ] |
Formats disponibles : Unified diff
agenda: fixing condition of displaying the other services appointments summary
Closes #5023