-
Notifications
You must be signed in to change notification settings - Fork 40
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
20087 - Statement locking and notification #1650
Conversation
Just taking this for a test drive now. |
# Correct for daylight savings. | ||
hours = target_datetime.astimezone(pytz.timezone('America/Vancouver')).utcoffset().total_seconds() / 60 / 60 | ||
target_date = target_datetime.replace(tzinfo=timezone.utc) + relativedelta(hours=-hours) | ||
return target_date.replace(tzinfo=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.
If i didn't do this, I would see weird behavour, would sometimes remove the hours.. but in the model unit test the hours* persists. tzinfo=None seems to make it always show the hours
@@ -21,7 +21,7 @@ | |||
from .db import db | |||
|
|||
|
|||
class NonSufficientFundsModel(BaseModel): # pylint: disable=too-many-instance-attributes | |||
class NonSufficientFunds(BaseModel): # pylint: disable=too-many-instance-attributes |
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.
renamed to make this consistent
@@ -51,6 +51,11 @@ class NonSufficientFundsModel(BaseModel): # pylint: disable=too-many-instance-a | |||
invoice_id = db.Column(db.Integer, ForeignKey('invoices.id'), nullable=False) | |||
invoice_number = db.Column(db.String(50), nullable=False, index=True, comment='CFS Invoice number') | |||
|
|||
@classmethod | |||
def find_by_invoice_id(cls, invoice_id: int): |
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.
small helper function only works on NonSufficientFunds (no complex joins to other entity types, should be fine)
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.
Looks good
This reverts commit 68f320d.
Issue #:
bcgov/entity#20087
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the sbc-pay license (Apache 2.0).