[Fixes #13935] Added extra_data JSONField on Profile#13938
[Fixes #13935] Added extra_data JSONField on Profile#13938
Conversation
Summary of ChangesHello @sijandh35, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a flexible mechanism for extending user profiles by adding a generic JSON field. This allows for the storage of arbitrary additional data without requiring schema modifications for every new attribute. Concurrently, it ensures that this sensitive or internal data is not inadvertently exposed through the public API, maintaining data privacy and API integrity. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces an extra_data JSONField to the Profile model, which is a good step towards improving extensibility. The changes include the model update, a database migration, and an update to the ProfileResource API to exclude the new field. The implementation is solid. I've provided a couple of suggestions to ensure consistency and prevent unintended side effects. Specifically, I've noted that the new field might be exposed in a user-facing form and that it should also be excluded from another API resource (OwnersResource) for completeness. Addressing these points will make this a more robust change.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #13938 +/- ##
==========================================
+ Coverage 74.19% 74.24% +0.04%
==========================================
Files 944 948 +4
Lines 56468 56624 +156
Branches 7651 7674 +23
==========================================
+ Hits 41899 42042 +143
- Misses 12885 12893 +8
- Partials 1684 1689 +5 🚀 New features to boost your workflow:
|
| # Exclude admins and anonymous user | ||
| users_to_update = get_user_model().objects.filter(pk__gt=0) | ||
| Profile = apps.get_model("people", "Profile") | ||
| users_to_update = Profile.objects.filter(pk__gt=0) |
There was a problem hiding this comment.
@sijandh35 if the intention is to exclude the anonymous group, i would prefer to have it excluded explicity rather than doint a pk__gt something like:
Profile.objects.exclude(username="AnonymousUser"))i think migth be worth to fix the migration even it comes from old changes
Fixes #13935
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.