summaryrefslogtreecommitdiff
path: root/openstack_dashboard
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-04-18 09:30:36 +0000
committerGerrit Code Review <review@openstack.org>2016-04-18 09:30:36 +0000
commitd3d5528b06599e5c65797a0c60ba08fd014ab176 (patch)
tree56a87fb916503f4d02566aa8e74209db46d895c7 /openstack_dashboard
parent73d4482b831d4c77ccb02c982a3607db080f4b24 (diff)
parentaf0d4dab7810e410560b1854ebf8db1188dab2e6 (diff)
downloadhorizon-d3d5528b06599e5c65797a0c60ba08fd014ab176.tar.gz
Merge "Added a warning message if User Name is empty"
Diffstat (limited to 'openstack_dashboard')
-rw-r--r--openstack_dashboard/dashboards/identity/users/tables.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/openstack_dashboard/dashboards/identity/users/tables.py b/openstack_dashboard/dashboards/identity/users/tables.py
index 3d2dabd95..4353f1b19 100644
--- a/openstack_dashboard/dashboards/identity/users/tables.py
+++ b/openstack_dashboard/dashboards/identity/users/tables.py
@@ -195,6 +195,11 @@ class UpdateCell(tables.UpdateAction):
try:
user_obj = datum
setattr(user_obj, cell_name, new_cell_value)
+ if ((not new_cell_value) or new_cell_value.isspace()) and \
+ (cell_name == 'name'):
+ message = _("The User Name field cannot be empty.")
+ messages.warning(request, message)
+ raise django_exceptions.ValidationError(message)
kwargs = {}
attr_to_keyword_map = {
'name': 'name',
@@ -228,7 +233,7 @@ class UsersTable(tables.DataTable):
name = tables.Column('name',
link="horizon:identity:users:detail",
verbose_name=_('User Name'),
- form_field=forms.CharField(),
+ form_field=forms.CharField(required=False),
update_action=UpdateCell)
description = tables.Column(lambda obj: getattr(obj, 'description', None),
verbose_name=_('Description'),