Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Kial Jinnah <[email protected]>
  • Loading branch information
kialj876 committed Jan 29, 2025
1 parent 175ec97 commit 4baa502
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion strr-api/src/strr_api/services/application_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def update_application_status(
application_id=application.id,
)

EmailService.sendApplicationStatusUpdateEmail(application)
EmailService.send_application_status_update_email(application)

return application

Expand Down
11 changes: 7 additions & 4 deletions strr-api/src/strr_api/services/email_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,15 @@ class EmailService:
"""Service to handle email logic and to interact with the email queue."""

@staticmethod
def sendApplicationStatusUpdateEmail(application: Application):
"""Send email notification for the application if applicable. Assumes the application.status has been changed."""
def send_application_status_update_email(application: Application):
"""Send email notification for the application if applicable.
Assumes the application.status has been changed."""
if application.status in APPLICATION_EMAIL_STATES:
try:
gcp_queue_publisher.publish_to_queue(
# NOTE: if registrationType / status typing (str vs enum) is updated in the model 'emailType' may need changes
# NOTE: if registrationType / status typing (str vs enum)
# is updated in the model 'emailType' may need changes
gcp_queue_publisher.QueueMessage(
source=EMAIL_SOURCE,
message_type=EMAIL_TYPE,
Expand All @@ -68,4 +71,4 @@ def sendApplicationStatusUpdateEmail(application: Application):
)
)
except Exception as err:
logger.error(f"Failed to publish email notification: {err.with_traceback(None)}")
logger.error("Failed to publish email notification: %s", err.with_traceback(None))

0 comments on commit 4baa502

Please sign in to comment.