-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Fixes #12594] Error when saving a new map #12595
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12595 +/- ##
=======================================
Coverage 64.26% 64.26%
=======================================
Files 888 888
Lines 53619 53627 +8
Branches 6608 6614 +6
=======================================
+ Hits 34458 34464 +6
- Misses 17646 17647 +1
- Partials 1515 1516 +1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I think
SETTINGS_MAPPING
is not a concern of the API module. - this mapping can be used in other places outside the API
For the reasons above I would implement the "mapping" inside the User model with something like:
def can_change_resource_field(self, resource, field):
match field:
case "is_published":
return self.can_publish(resource)
Checklist
For all pull requests:
The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):
Submitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.