Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: delete old user notification settings when merging users #26604

Merged
merged 1 commit into from
May 30, 2024

Conversation

dhiashalabi
Copy link
Contributor

@dhiashalabi dhiashalabi commented May 29, 2024

Summary

This pull request fixes an issue where merging users in the Frappe framework resulted in an error due to existing notification settings for the user being merged. The change ensures that the old user's notification settings are deleted during the merge process, preventing conflicts and allowing the merge to be completed successfully.

Detailed Explanation

Issue:
When attempting to merge two users, an error was encountered if the user being merged had existing notification settings. For example, merging user2 (user2@example.com) into user1 (user1@example.com) would fail with the following error:

Action Failed<br><br>Another Notification Settings with name user2@example.com exists, select another name

Error Traceback

psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "tabNotification Settings_pkey"
DETAIL:  Key (name)=(user2@example.com) already exists.
'''

@dhiashalabi dhiashalabi requested review from a team and ankush and removed request for a team May 29, 2024 14:03
@github-actions github-actions bot added the add-test-cases Add test case to validate fix or enhancement label May 29, 2024
@ankush ankush merged commit e97a56b into frappe:develop May 30, 2024
24 checks passed
@ankush ankush added the backport version-15-hotfix Backport the PR to v15 label May 30, 2024
mergify bot pushed a commit that referenced this pull request May 30, 2024
ankush pushed a commit that referenced this pull request May 31, 2024
#26619)

(cherry picked from commit e97a56b)

Co-authored-by: Dhia' Shalabi <dhia.shalabi@gmail.com>
@dhiashalabi dhiashalabi deleted the fix-user-merge-with-existing branch May 31, 2024 14:53
frappe-pr-bot pushed a commit that referenced this pull request Jun 4, 2024
## [15.29.1](v15.29.0...v15.29.1) (2024-06-04)

### Bug Fixes

* **address_query:** show search fields in description if set ([4db0b53](4db0b53))
* **address_query:** use title field if set ([01a00e3](01a00e3))
* allow creation of workspace based on desk role perms ([fb898f7](fb898f7))
* Auto Email Report not working when Add Total Row is enabled ([#26668](#26668)) ([e585657](e585657))
* Avoid concurrent TODO updates ([#26594](#26594)) ([cee96b9](cee96b9))
* bypass IP restriction for the methods required for our socketio backend ([42011c9](42011c9))
* **checkbox:** Fix checkbox size on small screens ([#26596](#26596)) ([#26612](#26612)) ([fc2a852](fc2a852))
* delete old user notification settings when merging users ([#26604](#26604)) ([#26619](#26619)) ([af1a47d](af1a47d))
* don't copy "Standard" on dashboard chart (backport [#26649](#26649)) ([#26651](#26651)) ([719522d](719522d))
* front-end bug in 'customize_form.js', triggered by delete actions on child-tables ([#26344](#26344)) ([b9f4845](b9f4845)), closes [#26041](#26041) [#26041](https://github.com/frappe/issues/26041) [#26041](#26041)
* kanban filters fixes ([#26605](#26605)) ([#26610](#26610)) ([af7f550](af7f550))
* **link-preview:** Correct synchronization of preview data on change. ([#26641](#26641)) ([#26654](#26654)) ([c34c1d1](c34c1d1))
* **make_request:** don't blindly try to check the content-type ([2fc914f](2fc914f))
* **number_card:** ensure value is returned ([0a91f04](0a91f04))
* **UX:** multi-tab experience ([#26309](#26309)) ([#26646](#26646)) ([3e4fff7](3e4fff7))

### Performance Improvements

* memory leak on kanban refresh ([#26597](#26597)) ([#26599](#26599)) ([8b8a297](8b8a297))
* rearrange some frequent jobs ([#26591](#26591)) ([#26603](#26603)) ([d9b7d73](d9b7d73))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
add-test-cases Add test case to validate fix or enhancement backport version-15-hotfix Backport the PR to v15
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants