Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should SlugRelatedField.slug_field be optional? #207

Open
YPCrumble opened this issue Apr 5, 2022 · 0 comments
Open

Should SlugRelatedField.slug_field be optional? #207

YPCrumble opened this issue Apr 5, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@YPCrumble
Copy link

Bug report

What's wrong

SlugRelatedField has None for a default parameter in its init function, but there is an assertion that prevents it from ever being None: https://github.com/encode/django-rest-framework/blob/0323d6f8955f987771269506ca5da461e2e7a248/rest_framework/relations.py#L455

What I think this means is that in these types, slug_field should not be Optional here: https://github.com/typeddjango/djangorestframework-stubs/blob/master/rest_framework-stubs/relations.pyi#L133

Thanks for maintaining this repo and for considering this issue! I'd be happy to make the PR if it's desirable.

@YPCrumble YPCrumble added the bug Something isn't working label Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant