Skip to content

Update dev branch#22

Merged
GitTimeraider merged 2 commits intodevelopfrom
main
Sep 1, 2025
Merged

Update dev branch#22
GitTimeraider merged 2 commits intodevelopfrom
main

Conversation

@GitTimeraider
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings September 1, 2025 11:58
@GitTimeraider GitTimeraider merged commit e519475 into develop Sep 1, 2025
4 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements currency localization for email notifications and improves the notification system reliability. The changes ensure that subscription costs are displayed in the user's preferred currency and prevent duplicate notifications from being sent.

  • Adds currency symbol mapping and localization for subscription costs in email notifications
  • Improves notification system reliability by setting flags before sending emails and handling failures
  • Prevents duplicate scheduler initialization

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
app/email.py Adds currency localization, improves notification timing logic, and prevents scheduler duplication
README.md Minor formatting change adding blank lines

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +281 to +284
# Set the notification sent flag BEFORE sending email to prevent race conditions
if not user.settings:
user_settings = UserSettings(user_id=user.id)
db.session.add(user_settings)
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When user.settings is None, a new UserSettings object is created but user_settings variable still refers to the old object from line 252. This will cause an AttributeError when trying to set last_notification_sent. The code should assign the new object to user_settings and update the user's settings relationship.

Suggested change
# Set the notification sent flag BEFORE sending email to prevent race conditions
if not user.settings:
user_settings = UserSettings(user_id=user.id)
db.session.add(user_settings)
db.session.add(user_settings)
user.settings = user_settings # Ensure relationship is set

Copilot uses AI. Check for mistakes.
Comment on lines +249 to +251
if user.settings:
db.session.refresh(user.settings)
user_settings = user.settings
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user_settings variable is only assigned when user.settings exists, but it's used unconditionally later in the code (lines 253, 285, 294). When user.settings is None, user_settings will be undefined, causing a NameError.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants