I'm currently using Django Rest Auth to handle user registration. I would like to add the possibility to choose which group from the ones available (or if not possible which permission) associate to the user that it is currently been created.
I have accomplished something for the serializer, which i report below, but i don't know how to go on on the views (I suppose I should inherit the RegisterView class, but i'm not sure how).
from dj_rest_auth.registration.serializers import RegisterSerializer
class GroupSerializer(serializers.ModelSerializer):
class Meta:
model = Group
fields = ('pk',)
class RegistrationSerializer(RegisterSerializer):
group = GroupSerializer(read_only=False, many=True)
I have searched for something already built-in in the package but it doesn't seems to exist.