-
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: Send email when change in session state #7157
Conversation
Codecov Report
@@ Coverage Diff @@
## development #7157 +/- ##
============================================
Coverage 62.84% 62.85%
============================================
Files 262 262
Lines 13055 13056 +1
============================================
+ Hits 8205 8206 +1
Misses 4850 4850
Continue to review full report at Codecov.
|
That's even worse. Read the issue again |
We want to send email if there's any change in session details. Then we won't be checking if there's |
That's the opposite of what we want. Why would we want that? Read the issue again carefully |
app/api/sessions.py
Outdated
new_state is not None | ||
and new_state != session.state | ||
and (new_state == 'accepted' or new_state == 'rejected') | ||
) |
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.
This should be written inside the if condition below
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.
This also does not contain the data.get('send_email') logic
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.
So below I should write (new_state == 'accepted' or new_state == 'rejected')
and data.get('send_email', None)
apart from g.send_email
?
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
Here is an overview of what got changed by this pull request: Complexity decreasing per file
==============================
+ app/api/sessions.py -1
See the complete overview on Codacy |
Fixes #7155
Short description of what this resolves:
Email was being sent only when the final session state is accepted or rejected.
Changes proposed in this pull request:
Send email when there's a change in session state.
Checklist
development
branch.