-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add user type filter for API and UI users on Users page #229
base: main
Are you sure you want to change the base?
Add user type filter for API and UI users on Users page #229
Conversation
@@ -14,6 +14,7 @@ | |||
) | |||
|
|||
from plots.users import make_api_requests_plot, make_api_frequency_requests_plot | |||
from nowcasting_datamodel.connection import DatabaseConnection |
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.
im not sure we need this
# If no URL, make a basic guess based on email (this is a fallback) | ||
# You might want to replace this with a more robust method | ||
is_ui = email.lower().endswith('@example.com') # Replace with actual UI user identifier | ||
return (user_type == "UI" and is_ui) or (user_type == "API" and not is_ui) |
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 was hoping the options could go into the _get_all_last_api_request_func
function below. Then we souldnt have to do any filtering afterwards
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.
This function is get_all_last_api_request
or get_all_last_api_request_sites
and I think with the latest versions of nowcatsing_datamodel or pv_site_datamodel they can take in variables of include_in_url
and exclude_in_url
, see https://github.com/openclimatefix/pv-site-datamodel/blob/main/pvsite_datamodel/read/user.py#L106
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.
sure, I will make the changes.
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.
thank you
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 have made changes
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.
did you push the changes?
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.
yes
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.
Sorry I can see them in this PR?
Pull Request
Description
Please delete the italicised instruction text!
Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes #
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration
If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check?
Checklist: