You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have encountered an error when updating child components in 0.18.0 that was not present in 0.17.2. I have a parent table with child rows created like so:
<tbody class="text-gray-500">
{% for payment in payments_display %}
{% unicorn 'payment_row' parent=view payment=payment key=payment.id %}
{% endfor %}
</tbody>
Each child row has a checkbox for the user to select the row for further processing:
When the checkbox is checked/unchecked, the child row add/removes itself from the list of selected rows on the parent, as defined in the component's toggle_check method:
Toggling the checkbox worked fine and as expected in 0.17.2 and prior versions. In version 0.18.0, I get the following error when clicking the checkbox:
Internal Server Error: /unicorn/message/payment_row
Traceback (most recent call last):
File "/Users/chris/miniconda3/envs/uqb/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/Users/chris/miniconda3/envs/uqb/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/chris/miniconda3/envs/uqb/lib/python3.9/site-packages/django_unicorn/decorators.py", line 59, in timed
result = wrapped(*args, **kwargs)
File "/Users/chris/miniconda3/envs/uqb/lib/python3.9/site-packages/django_unicorn/views.py", line 32, in wrapped_view
return view_func(*args, **kwargs)
File "/Users/chris/miniconda3/envs/uqb/lib/python3.9/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/Users/chris/miniconda3/envs/uqb/lib/python3.9/site-packages/django/views/decorators/http.py", line 40, in inner
return func(request, *args, **kwargs)
File "/Users/chris/miniconda3/envs/uqb/lib/python3.9/site-packages/django_unicorn/views.py", line 719, in message
json_result = _handle_component_request(request, component_request)
File "/Users/chris/miniconda3/envs/uqb/lib/python3.9/site-packages/django_unicorn/views.py", line 576, in _handle_component_request
return _process_component_request(request, component_request)
File "/Users/chris/miniconda3/envs/uqb/lib/python3.9/site-packages/django_unicorn/views.py", line 278, in _process_component_request
component = UnicornView.create(
File "/Users/chris/miniconda3/envs/uqb/lib/python3.9/site-packages/django_unicorn/decorators.py", line 59, in timed
result = wrapped(*args, **kwargs)
File "/Users/chris/miniconda3/envs/uqb/lib/python3.9/site-packages/django_unicorn/components.py", line 795, in create
component = _construct_component(
File "/Users/chris/miniconda3/envs/uqb/lib/python3.9/site-packages/django_unicorn/decorators.py", line 59, in timed
result = wrapped(*args, **kwargs)
File "/Users/chris/miniconda3/envs/uqb/lib/python3.9/site-packages/django_unicorn/components.py", line 787, in _construct_component
component.mount()
File "/Users/chris/proj/uqbproj/unicorn/components/payment_row.py", line 13, in mount
if self.payment['ucrmqb_posted'] == True:
TypeError: 'NoneType' object is not subscriptable
[01/Feb/2021 02:03:44] "POST /unicorn/message/payment_row HTTP/1.1" 500 16651
Is this a bug or do I have something incorrect?
The text was updated successfully, but these errors were encountered:
Sorry about this regression. This is a bug and it's related to kwargs being passed into a component (similar to #140). I've been trying to figure out a decent solution for most of today, but for now I would suggest to stay on 0.17.2. I am close to having a solution, but I would like to do more testing before releasing it so I don't create more problems. Sorry again for the issue -- I will update this issue when I release a fix (hopefully within the next day).
I just released 0.18.1 which should allow a component's parent to be set correctly again. Closing for now, but let me know if you run into other issues!
I have encountered an error when updating child components in 0.18.0 that was not present in 0.17.2. I have a parent table with child rows created like so:
Each child row has a checkbox for the user to select the row for further processing:
When the checkbox is checked/unchecked, the child row add/removes itself from the list of selected rows on the parent, as defined in the component's toggle_check method:
Toggling the checkbox worked fine and as expected in 0.17.2 and prior versions. In version 0.18.0, I get the following error when clicking the checkbox:
Is this a bug or do I have something incorrect?
The text was updated successfully, but these errors were encountered: