Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/rate_limiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def check_limit_and_increment_counters(self, key: str, tier_name: str) -> bool:
timestamp = self.redis.time()[0]
now = datetime.datetime.fromtimestamp(timestamp)
else:
now = datetime.datetime.utcnow()
now = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None)

# check AND increment usage counters
pipe = self.redis.pipeline()
Expand Down
20 changes: 10 additions & 10 deletions api/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def create_test_bill(
subject=subjects or [],
classification=classification or ["bill"],
extras={},
created_at=datetime.datetime.utcnow(),
updated_at=datetime.datetime.utcnow(),
created_at=datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None),
updated_at=datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None),
latest_action_date=f"{session.identifier}-02-{random.randint(10,30)}",
first_action_date=f"{session.identifier}-01-{random.randint(10,30)}",
)
Expand Down Expand Up @@ -330,8 +330,8 @@ def nebraska():
"division_id": "ocd-division/country:us/state:ne/sldu:1",
},
jurisdiction_id=j.id,
created_at=datetime.datetime.utcnow(),
updated_at=datetime.datetime.utcnow(),
created_at=datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None),
updated_at=datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None),
),
PersonName(
person_id=dummy_person_id("1"), name="Amy 'Aardvark' Adams", note="nickname"
Expand All @@ -357,17 +357,17 @@ def nebraska():
party="Libertarian",
current_role={"org_classification": "executive", "title": "Governor"},
jurisdiction_id=j.id,
created_at=datetime.datetime.utcnow(),
updated_at=datetime.datetime.utcnow(),
created_at=datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None),
updated_at=datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None),
),
Person(
id=dummy_person_id("3"),
name="Rita Red", # retired
birth_date="1973-12-25",
party="Republican",
jurisdiction_id=j.id,
created_at=datetime.datetime.utcnow(),
updated_at=datetime.datetime.utcnow(),
created_at=datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None),
updated_at=datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None),
),
]

Expand Down Expand Up @@ -434,8 +434,8 @@ def ohio():
subject=[],
classification=["bill"],
extras={},
created_at=datetime.datetime.utcnow(),
updated_at=datetime.datetime.utcnow(),
created_at=datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None),
updated_at=datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None),
latest_action_date="2021-01-01",
)
# sb1 = Bill(
Expand Down