Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#9747·django-rest-framework

a viewset's action list gets "head" added to it, but only after being called at least once

Author: rtpgCreated Jul 25, 2025Updated Aug 20, 2026

https://github.com/encode/django-rest-framework/blame/853969c69c815be69513c2f63a41285858a45352/rest_framework/viewsets.py#L106-L107

We didn't have head set in our actions on a viewset, but head would suddenly appear in a viewset's actions, but seemingly randomly.

This way of filling in head in actions means that before you call a viewset at least once, it will have one set of actions, but afterwards it would have another.

This is surprising to me, and I have a hard time imagining it to be the right solution here. But perhaps I am missing a detail.

Source: encode/django-rest-framework

View original on GitHubView discussion on GitHub