Description
I upgraded to 0.18.0, but started to see responses with
{"error": "Checksum does not match"}
on one of the pages.
My problem was a component like this:
class MyView(UnicornView):
text = "hello"
active = None
def __init__(self, *args, **kwargs):
super().__init__(**kwargs)
self.active = kwargs.get("active_tab", "default")
In the data sent I saw both active
and active_tab
.
It was an easy fix for me (I just made sure the parameter in kwargs was named the same as the class variable), but I thought other might get into the same problem, so i'm reporting it as a bug.
You can see the problem in action in this branch in the validation example:
- https://github.com/frbor/django-unicorn/blob/kwargs/example/unicorn/components/validation.py
- https://github.com/frbor/django-unicorn/blob/kwargs/example/www/templates/www/validation.html
I'm sorry if I overlooked any of this in the documentation, but I'm not sure whether this should work?
There might also be other reasons to send a parameter to kwargs without assigning it to the component?
On a side note I have had a couple of issues previously with the "Checksum does not match" error. I'm not sure what is checksumed, so might add that to the documentation some place?
Anyhow, impressive progress on the project. It has come a long way so far and keeps getting better!