Project

General

Profile

Bug #14691

Invalid user name string shown in the main menu on edit form

Added by Brad Buckingham almost 4 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:
Difficulty:
Triaged:
Bugzilla link:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1327670
Description of problem:
While updating own name/surname, the new string gets displayed in the main menu even when it's invalid (e.g. too long) (see screenshot).
This is not permanent as the form can't be successfully submitted and disappears as soon as user get the name right or cancels the form.

Version-Release number of selected component (if applicable):
6.2.0 snap 8.1

How reproducible:
always

Steps to Reproduce:
1. navigate to My Profile > Edit User
2. update first name/surname to some invalid string
3. hit submit

Actual results:
the name updates in the main menu even if it's not valid

Expected results:
no change is done until form successfully submits the valid data

Additional info:

Associated revisions

Revision 2f0bcd5a (diff)
Added by Shlomi Zadok almost 4 years ago

Fixes #14691 - User #to_label should show persisted name

Revision bd622a22 (diff)
Added by Dominic Cleal almost 4 years ago

refs #14691 - user editing self should not change User.current

Rather than changing the behaviour of #to_label to return persisted
data, the User.current object should not be modified with unsaved data
from the form submission or API update.

User.current is used for authz as well as for display purposes, so
shouldn't be changed. Parameter filtering protects privilege escalation
in this case.

Revision 36fae359 (diff)
Added by Dominic Cleal almost 4 years ago

refs #14691 - user editing self should not change User.current

Rather than changing the behaviour of #to_label to return persisted
data, the User.current object should not be modified with unsaved data
from the form submission or API update.

User.current is used for authz as well as for display purposes, so
shouldn't be changed. Parameter filtering protects privilege escalation
in this case.

(cherry picked from commit bd622a22e7679982e20002969bd53ee4154e4c1c)

Revision b4da35f8 (diff)
Added by Shlomi Zadok almost 4 years ago

Fixes #14691 - User #to_label should show persisted name

(cherry picked from commit 2f0bcd5a05b531b28700f638b902bb2c801013c3)

History

#1 Updated by Dominic Cleal almost 4 years ago

#2 Updated by Shlomi Zadok almost 4 years ago

  • Assignee set to Shlomi Zadok

#3 Updated by The Foreman Bot almost 4 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3436 added

#4 Updated by The Foreman Bot almost 4 years ago

  • Pull request https://github.com/theforeman/foreman/pull/3441 added

#5 Updated by Shlomi Zadok almost 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#6 Updated by Dominic Cleal almost 4 years ago

  • Legacy Backlogs Release (now unused) set to 155

Also available in: Atom PDF