Added a script to update a beamline#235
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new utility script for updating beamline records in the database. The script provides a targeted approach to modify specific fields (service accounts) without recreating the entire beamline object, addressing concerns about unintended side effects from full object replacement.
Changes:
- Added
scripts/update_beamline.pyto enable selective field updates for beamline records - Script fetches an existing beamline by PASS ID and updates only the service_accounts field
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
padraic-shafer
left a comment
There was a problem hiding this comment.
Thanks for making this script. You had a good idea to handle it separately from beamline creation.
In this case, only the service accounts were updated, but it would be good to point out where someone should inject additional changes, if needed.
I think it would be good practice to show the new object before it gets saved.
This PR introduces a new update script that modifies only the required fields when changes are needed, instead of creating a new object on every update.
The new approach selectively updates specific values, eliminating unintended side effects.