Empty email for users gets saved as an empty string

Bug #1265805 reported by Julie Pichon
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Alejandro Emanuel Paredes

Bug Description

Currently if we create/update a user without an email address using Horizon, an empty string is stored in the database.

mysql> select name, extra from user;
| test | {"email": ""} |

However, when using the keystone client, no email means storing 'null'/None.

$ keystone user-create --name anothertest --pass test
[...]
mysql> select name, extra from user;
| anothertest | {"email": null} |

We should match the keystone client behaviour, as storing empty strings is saving incorrect data that may cause issues, particularly with certain identity backends.

Changed in horizon:
assignee: nobody → alejandro emanuel paredes (alejandro-e-paredes)
Changed in horizon:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/65150

Changed in horizon:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/65150
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=311bbd7d16451e53775d316d0e45e1b47711c358
Submitter: Jenkins
Branch: master

commit 311bbd7d16451e53775d316d0e45e1b47711c358
Author: Alejandro Emanuel Paredes <email address hidden>
Date: Mon Jan 6 15:45:35 2014 -0500

    Empty email for users gets saved as an empty string

    The actual behavior is that horizon sends an empty string
    on the "email" field when creating a new user if the field
    isn't filled by the user.
    To match the keystone client behaviour, instead of sending
    an empty string, this patch sends a "None" value when the
    field isn't filled by the user.
    By doing this, when creating a new user from both,
    keystone client and horizon, a "null" value is stored
    under the same conditions.
    in the database. This will keep the data consistency.
    From the presentation point of view, when a "null" value
    is received, it is presented as an empty string instead
    of showing "None" on the "email" field of the users table.

    Change-Id: Ib5df774b3fe9d82c084f380c9c11aea46b2984aa
    Closes-Bug: #1265805

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
milestone: none → icehouse-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: icehouse-3 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.