Project

General

Profile

Actions

Patch #42467

open

Fix different display in "Email notification" `/my/account` when empty users.mail_notification

Added by Nishida Yuya 8 days ago. Updated 8 days ago.

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

  1. add new user by /users/new
  2. run following SQL on bin/rails dbconsole: UPDATE users SET mail_notification = '' WHERE id = (SELECT max(id) FROM users WHERE type = 'User');
  3. open /my/account and 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 #1

Updated by Nishida Yuya 8 days ago

This issue relates #42445 .

Actions

Also available in: Atom PDF