-
-
Notifications
You must be signed in to change notification settings - Fork 15
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 active flag to sites #166 #176
Add active flag to sites #166 #176
Conversation
it would be great to have an active flag on the sites table we can turn this on and off, dependent if the site is active
pvsite_datamodel/read/user.py
Outdated
|
||
include_in_url = None | ||
exclude_in_url = None | ||
|
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.
could you make these inputs toe the function, and they default to None?
pvsite_datamodel/read/user.py
Outdated
@@ -138,9 +149,17 @@ def get_api_requests_for_one_user( | |||
:param start_datetime: only get api requests after start datetime | |||
:param end_datetime: only get api requests before end datetime | |||
""" | |||
include_in_url = None |
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.
same comment as above?
hi @PrabhasKalyan thanks so much for doing this Ive left a small comment on this, Would you also be able to
|
Adding include_in_url = None exclude_in_url = None to function Adding alembic migrations adding tests put tests/test_write.py in test/write
…abhasKalyan/pv-site-datamodel into Add-active-flag-to-sites-#166
pvsite_datamodel/read/user.py
Outdated
def get_all_last_api_request( | ||
session: Session, | ||
include_in_url=None, | ||
exclude_in_url=None, |
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.
can you do exclude_in_url: Optional[str] = None
, you my need to add a import, from typing import Optional
Could you add a sentence in hte function description too?
tests/read/test_get_api_requests.py
Outdated
@@ -48,5 +59,7 @@ def test_get_api_requests_for_one_user_end_datetime(db_session): | |||
session=db_session, | |||
email=user.email, | |||
end_datetime=dt.datetime.now(tz=dt.timezone.utc) - dt.timedelta(hours=1), | |||
include_in_url=None, | |||
exclude_in_url=None, | |||
) | |||
assert len(requests_sql) == 0 |
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.
perhaps leave this test how they are, and add a new test, where we can clear see that the include_in_url
is working, i.e. set it to a value. Simialr for exclude_in_url
This pull request adds an active flag to the sites table, allowing sites to be toggled on or off based on their active status. The change has been tested for functionality and includes relevant tests to ensure compliance with guidelines.