Skip to content

Commit

Permalink
- Attempting to fix a bug with adjustment request reviewers not loadi…
Browse files Browse the repository at this point in the history
…ng properly
  • Loading branch information
rptmat57 committed Jul 5, 2024
1 parent ae2912c commit 52b55c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions NEMO/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4243,8 +4243,9 @@ def creator_and_reply_users(self) -> List[User]:
def reviewers(self) -> QuerySetType[User]:
# Create the list of users to notify/show request to. If the adjustment request has a tool/area and their
# list of reviewers is empty, send/show to all facility managers
tool: Tool = getattr(self.item, "tool", None) if self.item else None
area: Area = getattr(self.item, "area", None) if self.item else None
item = get_model_instance(self.item_type, self.item_id)
tool: Tool = getattr(item, "tool", None) if item else None
area: Area = getattr(item, "area", None) if item else None
facility_managers = User.objects.filter(is_active=True, is_facility_manager=True)
if tool:
tool_reviewers = tool._adjustment_request_reviewers.filter(is_active=True)
Expand Down

1 comment on commit 52b55c3

@g2hollow
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran into this bug. It was causing multiple unnecessary notifications for adjustment requests that were not subsequently deleted. This fix works well for me

Please sign in to comment.