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(project/serializer): limit edit to only fields that make sense #4846

Merged
merged 3 commits into from
Nov 20, 2024

Conversation

gagantrivedi
Copy link
Member

@gagantrivedi gagantrivedi commented Nov 19, 2024

Thanks for submitting a PR! Please check the boxes below:

  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

Stop User from updating organisation, enable_dynamo_db and edge_v2_migration_status

How did you test this code?

Covered by unit tests

@gagantrivedi gagantrivedi requested a review from a team as a code owner November 19, 2024 11:52
@gagantrivedi gagantrivedi requested review from matthewelwell and removed request for a team November 19, 2024 11:52
Copy link

vercel bot commented Nov 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Nov 20, 2024 5:36am
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Nov 20, 2024 5:36am
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Nov 20, 2024 5:36am

@github-actions github-actions bot added the api Issue related to the REST API label Nov 19, 2024
Copy link
Contributor

github-actions bot commented Nov 19, 2024

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-4846 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-4846 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-4846 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-4846 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-4846 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4846 Finished ✅ Results

@github-actions github-actions bot added the fix label Nov 19, 2024
Copy link
Contributor

github-actions bot commented Nov 19, 2024

Uffizzi Preview deployment-58356 was deleted.

Copy link
Contributor

@matthewelwell matthewelwell left a comment

Choose a reason for hiding this comment

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

Approved with a minor comment

Comment on lines 52 to 55
def update(self, instance: Project, validated_data: dict) -> Project:
# Prevent updates to `organisation` field
validated_data.pop("organisation", None)
return super().update(instance, validated_data)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's perhaps better to just add a new serializer for update requests which adds organisation to the read only fields?

@github-actions github-actions bot added fix and removed fix labels Nov 20, 2024
@github-actions github-actions bot added fix and removed fix labels Nov 20, 2024
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.35%. Comparing base (9b21af7) to head (5c76bd3).
Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4846   +/-   ##
=======================================
  Coverage   97.35%   97.35%           
=======================================
  Files        1182     1183    +1     
  Lines       41287    41306   +19     
=======================================
+ Hits        40194    40213   +19     
  Misses       1093     1093           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@matthewelwell matthewelwell merged commit 86ba762 into main Nov 20, 2024
34 checks passed
@matthewelwell matthewelwell deleted the fix/project-serializer branch November 20, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants