Skip to content

Commit

Permalink
Z filtrem "niezarezerwowanych prac" nie wyświetlamy tych obronionych (#…
Browse files Browse the repository at this point in the history
…1469)

Efekt na pewno nie jest jeszcze zgodny z intencją, ale do tego nie obejdzie się bez pewnego zadbania o jakość danych (ponieważ GIGO) i/lub samego ich modelu.
  • Loading branch information
Brychlikov authored Sep 29, 2024
1 parent 7bc22a8 commit 12835ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions zapisy/apps/theses/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ def has_no_students_assigned(self):
def is_reserved(self):
return self.reserved_until and date.today() <= self.reserved_until

@property
def is_available(self):
is_defended = self.status == ThesisStatus.DEFENDED
return not (self.is_reserved or is_defended)

@property
def has_been_accepted(self):
return self.status != ThesisStatus.RETURNED_FOR_CORRECTIONS and self.status != ThesisStatus.BEING_EVALUATED
Expand Down
2 changes: 1 addition & 1 deletion zapisy/apps/theses/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def list_all(request):
theses_list = []
for p in visible_theses:
title = p.title
is_available = not p.is_reserved
is_available = p.is_available
kind = p.get_kind_display()
status = p.get_status_display()
is_mine = p.is_mine(request.user) or p.is_student_assigned(
Expand Down

0 comments on commit 12835ab

Please sign in to comment.