-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix: Handle ticket fee not found error in send monthly invoice #6924
Conversation
app/api/helpers/scheduled_jobs.py
Outdated
raise ObjectNotFound( | ||
{'source': ''}, 'Ticket Fee not set for {}'.format(currency) | ||
) | ||
app.logger.error('Ticket Fee not found for event id {id}'.format(id=event.id)) |
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.
line too long (94 > 90 characters)
This pull request introduces 1 alert when merging 464e767 into cd5a273 - view on LGTM.com new alerts:
|
@iamareebjamal - Am I logging the error in a wrong way? |
app/api/helpers/scheduled_jobs.py
Outdated
raise ObjectNotFound( | ||
{'source': ''}, 'Ticket Fee not set for {}'.format(currency) | ||
) | ||
app.logger.error('Ticket Fee not found for event id {id}'.format(id=event.id)) |
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.
Don't use app.logger
Create a new logger with __name__
app/api/helpers/scheduled_jobs.py
Outdated
raise ObjectNotFound( | ||
{'source': ''}, 'Ticket Fee not set for {}'.format(currency) | ||
) | ||
logging.getLogger(__name__).error('Ticket Fee not found for event id {id}'.format(id=event.id)) |
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.
line too long (111 > 90 characters)
Codecov Report
@@ Coverage Diff @@
## development #6924 +/- ##
===============================================
- Coverage 66.40% 66.39% -0.01%
===============================================
Files 313 313
Lines 15358 15360 +2
===============================================
+ Hits 10198 10199 +1
- Misses 5160 5161 +1
Continue to review full report at Codecov.
|
@iamareebjamal - Review |
app/api/helpers/scheduled_jobs.py
Outdated
raise ObjectNotFound( | ||
{'source': ''}, 'Ticket Fee not set for {}'.format(currency) | ||
) | ||
logging.getLogger(__name__)\ |
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.
No
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.
@iamareebjamal - Shall I create a global variable logger here?
logger = logging.getLogger(__name__)
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.
Yes
Fixes #6869
Short description of what this resolves:
Ticket fee not found error in send monthly invoice
Changes proposed in this pull request:
Skip that entry and log an error
Checklist
development
branch.