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

Jlc/extende usersupport admin #230

Merged
merged 9 commits into from
Nov 6, 2024
Merged

Conversation

johanseto
Copy link
Collaborator

@johanseto johanseto commented Oct 31, 2024

Description

feat: add nelpUser admin

This admin user adds:

  • national_id from extra_info instance in list_display
  • search by national_id

Testing instructions

After

  • Check lms user admin has national_id field
  • search by national_id in user admin
Screencast.from.31-10-24.16.59.09.webm
  • check studio is working and user admin is not modified

Screenshot from 2024-11-01 11-23-00

Additional information

jira story

Checklist for Merge

  • Tested in a remote environment
  • Updated documentation
  • Rebased master/main
  • Squashed commits

@johanseto johanseto force-pushed the jlc/extender-usersupport-admin branch from a1ebb76 to 7ec0738 Compare October 31, 2024 23:39
@johanseto johanseto changed the title Jlc/extender usersupport admin Jlc/extende usersupport admin Oct 31, 2024
This admin user adds:
- national_id from extra_info instance in list_display
- search by national_id

chore
@johanseto johanseto force-pushed the jlc/extender-usersupport-admin branch from 7ec0738 to 2d14a9e Compare October 31, 2024 23:43
@johanseto johanseto marked this pull request as ready for review November 1, 2024 18:35
list_display = SupportUserAdmin.list_display[:2] + ('user_national_id',) + SupportUserAdmin.list_display[2:]
search_fields = SupportUserAdmin.search_fields + ('extrainfo__national_id',)
fieldsets = SupportUserAdmin.fieldsets + (
('Extra info Fields', {'fields': ('user_national_id',)}),
Copy link
Collaborator

Choose a reason for hiding this comment

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

could you include this in the personal info section ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why you dont want to split to extra info fields. Here could be first_arabic_name, or is_phone_validated.
That fields belongs to extra_info model. So they should go to that table or admin model to check

Copy link
Collaborator

Choose a reason for hiding this comment

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

This kind of classification just makes sense for us, for someone who doesn't know about tables or models this could be more confusing, on the other hand, if the purpose is to facilitate the navigation to extra info table, don't add a national id, add a link to the instance, anyway, if you consider that is too hard or that you have to copy the whole Personal info, to achieve that, please keep this way

Copy link
Collaborator Author

@johanseto johanseto Nov 5, 2024

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can simplify this file, basically the new model only has effects if eox-support is installed
so if you move this condition if find_spec('eox_support') and 'eox_support.apps.EoxSupportConfig' in settings.INSTALLED_APPS: to a higher level ( eox_vnelp/admin/init.py) you can remove all those repeated validations from this file.

Just one question, why you didn't include eox-support as requierement?

Copy link
Collaborator Author

@johanseto johanseto Nov 1, 2024

Choose a reason for hiding this comment

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

This is basically because the admin of eox_support uses a lot of edx_app wrappers. So, this started to bother with this kind of error in the test environment.

Screenshot from 2024-10-31 18-22-25

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also moved to init file the if condition.
606b4eb

Copy link
Collaborator

@andrey-canon andrey-canon left a comment

Choose a reason for hiding this comment

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

LGTM

@johanseto johanseto merged commit b3d700c into master Nov 6, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants