AttributeError in Edit Extra Spec form.

Bug #1685822 reported by wei.ying
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
In Progress
Low
wei.ying

Bug Description

Env: devstack master branch

Steps to reproduce:

1. Go to admin/volume Volume Types panel
2. Volume Types -> Click View Extra Specs -> Click Edit
3. Remove the 'Value' value (which is a required field). On form submit

Error info:
Internal Server Error: /admin/volume_types/b780ccbf-b45d-4b80-ac6d-d5e84eb993cc/extras/volume_backend_name/edit/
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/stack/horizon/horizon/decorators.py", line 36, in dec
    return view_func(request, *args, **kwargs)
  File "/opt/stack/horizon/horizon/decorators.py", line 52, in dec
    return view_func(request, *args, **kwargs)
  File "/opt/stack/horizon/horizon/decorators.py", line 36, in dec
    return view_func(request, *args, **kwargs)
  File "/opt/stack/horizon/horizon/decorators.py", line 84, in dec
    return view_func(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py", line 89, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/views/generic/edit.py", line 217, in post
    return self.form_invalid(form)
  File "/opt/stack/horizon/openstack_dashboard/dashboards/admin/volume_types/extras/views.py", line 125, in form_invalid
    context = self._populate_context(context)
AttributeError: 'EditView' object has no attribute '_populate_context'
[24/Apr/2017 15:26:58] "POST /admin/volume_types/b780ccbf-b45d-4b80-ac6d-d5e84eb993cc/extras/volume_backend_name/edit/ HTTP/1.1" 500 142967

wei.ying (wei.yy)
Changed in horizon:
assignee: nobody → wei.ying (wei.yy)
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/459396

Changed in horizon:
status: New → In Progress
Revision history for this message
Ying Zuo (yingzuo) wrote :

I didn't get the AttributeError with horizon master branch. Instead, I got error message "please fill out this field" shown in a tooltip, but it should be shown below the field instead.

Changed in horizon:
importance: Undecided → Low
Revision history for this message
wei.ying (wei.yy) wrote :

Hi Ying. Thanks for your comments.
When I upgraded the local environment, the problem didn't come back.

I'm not sure why the following method was not called again when the edit extra specs form was submitted.
But If the form_invalid function[1] is called, it will cause error. Due to the method '_populate_context has then redefined in [2].

[1] https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/admin/volume_types/extras/views.py#L123.
[2] https://review.openstack.org/#/c/337703/7/horizon/forms/views.py

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (master)

Change abandoned by Ivan Kolodyazhny (<email address hidden>) on branch: master
Review: https://review.openstack.org/459396
Reason: This review is > 4 months without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

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.