removed excess tom toolkit overwrite and added snex1 pw account deletion sync#148
Open
moira-andrews wants to merge 2 commits intodevfrom
Open
removed excess tom toolkit overwrite and added snex1 pw account deletion sync#148moira-andrews wants to merge 2 commits intodevfrom
moira-andrews wants to merge 2 commits intodevfrom
Conversation
crpellegrino
reviewed
Feb 6, 2026
Collaborator
crpellegrino
left a comment
There was a problem hiding this comment.
Nice job! Here's a couple mostly high-level comments to consider
|
|
||
| return encpw | ||
|
|
||
| @receiver(user_logged_in) |
Collaborator
There was a problem hiding this comment.
This may be a dumb question, but does this run every time the user logs in, or just the first time? Doing this every time is probably overkill
Comment on lines
+940
to
+942
| if delete: | ||
| db_session.query(Users).filter(Users.name == user.username).delete() | ||
| logger.info(f'User {user.username} deleted from SNEx1') |
Collaborator
There was a problem hiding this comment.
How does deleting users work in SNEx1? I don't know if I've ever done it, so not sure what the implications would be on anything that's connected to the user. Hopefully not a cascading delete on things like observation sequences, targets, etc?
Collaborator
Author
There was a problem hiding this comment.
That's a great point, I haven't tested it with that, I'll need to go through and check this.
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Mostly cleaned up registration functionality to pull as much as possible from base tom toolkit. Refactored the
sync_users_with_snex1to include the snex1 password. This hook is run on user login, so it will update the snex1 database with a new password hash each time a user logs in. So when a new user registers an account on snex2, they will have a working snex1 account after they log into snex2 for the first time. This also works for any group or user account changes on snex2, they are updated and reflected on snex1 on next snex2 login.I also added functionality to delete accounts, which functions similarly to the comment deletion implemented in #138. When a user is deleted, they are also deleted from the supernovadb Users table.
Test by spinning up a local installation of snexdev with snex1 and snex2, create a user in snex2, approve the user, and login. Then open up the local snex1 and ensure the new user can login. Also test existing users by logging into both snex1 and snex2 and ensuring success on both ends.
If testing on the small database, make sure to add the snex2 admin account to a group and re-signing in. Otherwise the snex1 user list page won't display correctly because there is a user with no group.
Before merging, logging statements need to be removed.