Files
notifications-admin/app/notify_client/status_api_client.py
Carlo Costino 86fbaee27d Adjust positional arguments flagged by flake8-bugbear
The new release of flake8-bugbear is starting to flag positional argument unpacking that comes after keyword arguments in function calls as a style warning that fails.  This is a good thing to catch because it can lead to unexpected side effects with function arguments and/or errors thrown by Python.

See the following links for more details:

- https://stackoverflow.com/questions/58961715/python-value-unpacking-order-in-method-parameters
- https://github.com/python/cpython/issues/82741

This changeset fixes a couple of instances where the positional argument unpacking was happening after keyword arguments were being provided.

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
2023-11-29 09:39:44 -05:00

18 lines
664 B
Python

from app.notify_client import NotifyAdminAPIClient, cache
class StatusApiClient(NotifyAdminAPIClient):
def get_status(self, *params):
return self.get(*params, url="/_status")
@cache.set("live-service-and-organization-counts", ttl_in_seconds=3600)
def get_count_of_live_services_and_organizations(self):
return self.get(url="/_status/live-service-and-organization-counts")
@cache.set("live-service-and-organization-counts", ttl_in_seconds=3600)
def get_count_of_live_services_and_organizations_cached(self):
return self.get(url="/_status/live-service-and-organization-counts")
status_api_client = StatusApiClient()