Skip to content

[user_manager/user_info] refactor get_users_info and UserInfo - #1179

Open
anthonygego wants to merge 1 commit into
mainfrom
fix_issue_1177
Open

anthonygego wants to merge 1 commit into
mainfrom
fix_issue_1177

Conversation

@anthonygego

Copy link
Copy Markdown
Member

This addresses issue reported in #1177 and provides a first refactor UserManager.get_users_info.

  • get_users_info was actually used in two cases with different signatures (usernames or limit, skip actually used)
    • recovered the previous signature without optional arguments, as well as the default to None.
    • usage with limit and skip did not need a dictionary mapping: replaced by a simple mongoengine request as a first approximation, and updated the template accordingly.
  • UserInfo was a redundant data structure since mongoengine migration. Removed it and returned User model directly. Adapted code.
    I recall this was introduced to limit the risk of exposing the raw dictionary with confidential data in templates, but mongoengine does not allow to dump the whole model values implicitly, so the requirements are kept.

Also fix missing None in case users are not found
Closes #1177

Co-authored-by: Tor Andre Haugdahl <thaugdahl@gmail.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant