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!: allow system managers to toggle email queue #17466
Merged
mergify
merged 2 commits into
frappe:develop
from
resilient-tech:remove-client.set_default
Jul 19, 2022
Merged
fix!: allow system managers to toggle email queue #17466
mergify
merged 2 commits into
frappe:develop
from
resilient-tech:remove-client.set_default
Jul 19, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sagarvora
force-pushed
the
remove-client.set_default
branch
from
July 11, 2022 17:05
bc41e2c
to
eb76b45
Compare
sagarvora
force-pushed
the
remove-client.set_default
branch
3 times, most recently
from
July 11, 2022 17:38
b0aa24e
to
861947d
Compare
sagarvora
commented
Jul 11, 2022
sagarvora
force-pushed
the
remove-client.set_default
branch
from
July 13, 2022 16:08
861947d
to
b9ff823
Compare
sagarvora
force-pushed
the
remove-client.set_default
branch
from
July 18, 2022 16:53
b9ff823
to
9a7f92c
Compare
Codecov Report
@@ Coverage Diff @@
## develop #17466 +/- ##
===========================================
+ Coverage 56.62% 57.00% +0.37%
===========================================
Files 760 768 +8
Lines 68219 69016 +797
Branches 5835 6003 +168
===========================================
+ Hits 38632 39343 +711
- Misses 25946 26192 +246
+ Partials 3641 3481 -160
Flags with carried forward coverage won't be shown. Click here to find out more. |
surajshetty3416
approved these changes
Jul 19, 2022
@Mergifyio backport version-13-hotfix |
✅ Backports have been created
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #14218
Why did the Resume / Suspend Sending button only work for Administrator?
The button set the default
hold_queue
using thefrappe.defaults.set_default
JS API which called thefrappe.client.set_default
API without explicitly passing aparent
. In absence of a parent, theset_default
API chosefrappe.session.user
as one (why?). When processing the queue inEmailQueue.process
, we're usingfrappe.defaults.get_defaults
which gets defaults from the__default
+frappe.session.user
parents. When called from redis queue, thefrappe.session.user
is Administrator. Hence,get_defaults
gives the correct value ofhold_queue
only if set by Administrator, but not other users.Changes Made
BREAKING: remove
frappe.client.set_default
and the correspondingfrappe.default.set_default
API. Shouldn't affect a lot of users:https://sourcegraph.com/search?q=context:global+frappe.client.set_default&patternType=literal
https://sourcegraph.com/search?q=context:global+frappe.defaults.set_default+lang:javascript+&patternType=literal
New whitelisted method for System Managers to toggle sending - corresponding implementation in
email_queue_list.js
The toggle between List View and other views wasn't showing before due to call of
clear_inner_toolbar
- fixed.Use
frappe.db.get_default
instead offrappe.defaults.get_defaults
when checkinghold_queue
.Patch to set
hold_queue
in the__default
parent instead ofAdministrator
, and to remove the default from all other user parents.Update existing whitelisted methods to check permission.
Screenshots
Patch Test
UI