Actions
Patch #42467
openFix different display in "Email notification" `/my/account` when empty users.mail_notification
Status:
New
Priority:
Normal
Assignee:
-
Category:
UI
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Description
Background¶
User#notify_about? considers users.mail_notification = '' as users.mail_notification = 'none'. But "Email notification" section in /my/account represents "For any event on all my projects" (all) when users.mail_notification = ''. They are different behaviour.
How to reproduce¶
- add new user by
/users/new - run following SQL on
bin/rails dbconsole:UPDATE users SET mail_notification = '' WHERE id = (SELECT max(id) FROM users WHERE type = 'User'); - open
/my/accountand login by new user
Before patch¶
"Email notifications" section is selected "For any event on all my projects". It's different behaviour from User#notify_about?.
After patch¶
"Email notifications" section is selected "No events". It's same behaviour with User#notify_about?.
This patch makes...¶
This patch adds User#normalized_mail_notification method. It returns 'none' if empty string users.mail_notification. We won't have to worry about invalid users.mail_notification cases.
Files
Actions