[PR #1301] [MERGED] break from loop once a valid policy is found. remove old unused list #1847

Closed
opened 2026-03-02 02:25:00 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amidaware/tacticalrmm/pull/1301
Author: @af7567
Created: 10/3/2022
Status: Merged
Merged: 10/6/2022
Merged by: @wh1te909

Base: developHead: policyselect2


📝 Commits (2)

  • 24c899c break from loop once a valid policy is found. remove old unused list
  • db45400 remove parentheses from if statement to fix codestyle test

📊 Changes

1 file changed (+4 additions, -7 deletions)

View changed files

📝 api/tacticalrmm/agents/models.py (+4 -7)

📄 Description

get_patch_policy() was always going through to the end of the agent policies list instead of breaking from the loop once a valid policy is found. Since get_agent_policies() returns the list in order of preference, the least preferred policy was always getting selected.

Also removed the processed_policies list which is not used, seems to be left over from when the policy was selected a different way.

Fixes #1293


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/amidaware/tacticalrmm/pull/1301 **Author:** [@af7567](https://github.com/af7567) **Created:** 10/3/2022 **Status:** ✅ Merged **Merged:** 10/6/2022 **Merged by:** [@wh1te909](https://github.com/wh1te909) **Base:** `develop` ← **Head:** `policyselect2` --- ### 📝 Commits (2) - [`24c899c`](https://github.com/amidaware/tacticalrmm/commit/24c899c91ac5d5c3bd99894d6c7a624e9a692377) break from loop once a valid policy is found. remove old unused list - [`db45400`](https://github.com/amidaware/tacticalrmm/commit/db4540089ae3d415cc239d5025859d7008fcaf94) remove parentheses from if statement to fix codestyle test ### 📊 Changes **1 file changed** (+4 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `api/tacticalrmm/agents/models.py` (+4 -7) </details> ### 📄 Description `get_patch_policy()` was always going through to the end of the agent policies list instead of breaking from the loop once a valid policy is found. Since `get_agent_policies()` returns the list in order of preference, the least preferred policy was always getting selected. Also removed the `processed_policies` list which is not used, seems to be left over from when the policy was selected a different way. Fixes #1293 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 02:25:00 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tacticalrmm#1847
No description provided.