Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Fix error when editing user permissions #500

Merged
merged 1 commit into from
May 11, 2022

Conversation

TheAndrewJackson
Copy link
Contributor

Purpose

A 500 error is thrown when trying to edit a users permissions. This updates the backend to use the correct method so updates don't trigger the following error:

sqlalchemy.exc.IntegrityError: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "fidesopsuserpermissions_user_id_key"

Changes

  • update method from create_or_update to update

Checklist

  • Applicable documentation updated (guides, quickstart, postman collections, tutorial, fidesdemo, database diagram.
  • If docs updated (select one):
    • documentation complete, or draft/outline provided (tag docs-team to complete/review on this branch)
    • documentation issue created (tag docs-team to complete issue separately)
  • Good unit test/integration test coverage
  • This PR contains a DB migration. If checked, the reviewer should confirm with the author that the down_revision correctly references the previous migration before merging
  • The Run Unsafe PR Checks label has been applied, and checks have passed, if this PR touches any external services

Ticket

Fixes #499

@TheAndrewJackson TheAndrewJackson added the bug Something isn't working label May 11, 2022
Copy link
Contributor

@seanpreston seanpreston left a comment

Choose a reason for hiding this comment

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

Thanks for this! Would be good to include a test that would fail under the previous conditions too.

@seanpreston seanpreston dismissed their stale review May 11, 2022 19:43

No longer required

@seanpreston seanpreston merged commit 43c487c into main May 11, 2022
@seanpreston seanpreston deleted the 499_failing_to_edit_user_permissions branch May 11, 2022 19:43
adamsachs pushed a commit to adamsachs/fidesops_forked_test that referenced this pull request May 17, 2022
sanders41 pushed a commit that referenced this pull request Sep 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

500 error when editing user permissions
2 participants