Skip to content

Commit

Permalink
refactor: restore checkers property name
Browse files Browse the repository at this point in the history
  • Loading branch information
pirhoo committed Jan 22, 2024
1 parent 60129d7 commit 2ece467
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prophecies/core/models/task_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ def __str__(self):
return f'Record #{self.id} to be review in {self.task.name}'

@cached_property
def checkers_list(self):
def checkers(self):
checkers = [review.checker for review in self.reviews.all()]
return list(filter(None, checkers))

@cached_property
def checkers_pretty(self):
# Extract only the usernames
usernames = [checker.username for checker in self.checkers_list]
usernames = [checker.username for checker in self.checkers]
count = len(usernames)
# Use the correct format depending on the count or use `many`
return {0: lambda u: 'nobody', 1: lambda u: u[0], 2: lambda u: ' and '.join(u), }.\
Expand Down Expand Up @@ -99,7 +99,7 @@ def actions(self):
return Action.objects.public(self.actions_query | self.reviews_actions_query)

def can_lock(self, user):
checkers_ids = [checker.id for checker in self.checkers_list]
checkers_ids = [checker.id for checker in self.checkers]
return not self.locked and user.id in checkers_ids

def can_unlock(self, user):
Expand Down

0 comments on commit 2ece467

Please sign in to comment.