jonathan-s / django-sockpuppet

Build reactive applications with the django tooling you already know and love.
https://github.com/jonathan-s/django-sockpuppet
MIT License
450 stars 22 forks source link

Spread operators necessary on variables passed to the view function. #86

Closed DamnedScholar closed 3 years ago

DamnedScholar commented 3 years ago

This is actually a pretty substantial bug that I only now encountered when trying to reload a DetailView. I couldn't figure out why it wasn't able to read the URLconf until I walked through the code and discovered that the problem was immediately fixed when I applied the spread operators in the view() invocation.

DamnedScholar commented 3 years ago

And in case anyone wants an example of why this change represents correct Python, this invocation works the same way. resolved.args is a single list argument and *resolved.args is a sequence of positional arguments.

jonathan-s commented 3 years ago

@DamnedScholar Thanks for this. I was thinking of adding some tests for this as integrationstests, but since you are on the master branch I can't easily do that. Would you mind creating a new PR with a branch, or would you prefer that I create a branch and just cherry pick this commit?

DamnedScholar commented 3 years ago

Sorry. I did the smart thing by using branches to PR multiple changes at once, but was lazy about not making the main change on a branch. I'll branch my local repo and make another PR inside the hour.