Skip to content

Commit

Permalink
fix: docenti cessati
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Oct 9, 2023
1 parent d806bf6 commit fde6806
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions ricerca_app/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -1907,18 +1907,19 @@ def getAttivitaFormativeByDocente(teacher, year, yearFrom, yearTo):

@staticmethod
def getDocenteInfo(teacher):
query1 = Personale.objects.filter(
didatticacopertura__af__isnull=False,
matricola__exact=teacher,
flg_cessato=0).distinct()
query2 = Personale.objects.filter(
fl_docente=1,
flg_cessato=0,
matricola__exact=teacher).distinct()
query1 = Personale.objects\
.filter(didatticacopertura__af__isnull=False,
matricola__exact=teacher,
Q(flg_cessato=0) | Q(didatticacoperatura__aa_off_id=datetime.datetime.now().year)\
.distinct()
query2 = Personale.objects.filter(fl_docente=1,
flg_cessato=0,
matricola__exact=teacher)\
.distinct()

query = (query1 | query2).distinct()

if not query:
if not query.exists():
raise Http404

contacts_to_take = [
Expand Down

0 comments on commit fde6806

Please sign in to comment.