-
Notifications
You must be signed in to change notification settings - Fork 165
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
Revert "feat: add tags to creator registration" #1109
Conversation
This reverts commit 684dbf7.
Please this should work with @coderatomy new UI the signup |
It does not work. I just tested it now |
@@ -186,7 +188,6 @@ class RegisterCreatorAPIView(RegisterView): | |||
"location": "string",\n | |||
"bio": "",\n | |||
"subscribe": false\n | |||
"creator_tags": "string",\n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here you are specifying that creator_tags
is a string, but you were treating it like an array everywhere else
def get_cleaned_data(self): | ||
data_dict = super().get_cleaned_data() | ||
data_dict['phone'] = self.validated_data.get('phone', '') | ||
data_dict['dateOfBirth'] = self.validated_data.get('dateOfBirth', '') | ||
data_dict['location'] = self.validated_data.get('location', '') | ||
data_dict['bio'] = self.validated_data.get('bio', '') | ||
data_dict['subscribe'] = self.validated_data.get('subscribe', '') | ||
data_dict['creator_tags'] = self.validated_data.get('creator_tags', []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here you treat creator_tags
as an array
@@ -198,8 +199,6 @@ class CustomRegisterSerializer(RegisterSerializer): | |||
queryset=Location.objects.all()) | |||
bio = serializers.CharField(allow_blank=True, default="", max_length=255) | |||
subscribe = serializers.BooleanField(default=False) | |||
creator_tags = serializers.SlugRelatedField(slug_field='name', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the syntax here is basically saying Creator.objects.all().filter(name=<value of creator_tags coming from the frontend>)[0], or something like that
. But the value of the creator_tags coming from the frontend given the way we are trying to extract it and the default we are providing, is an array, so won't work
from the reviews above, you can see that you are mixing the |
Reverts #1082
there is an error in this PR that makes it impossible to register a new user. @yokwejuste you should look at this again and try to verify that it works before creating a PR again. I assumed you already did that so didn't test properly before merging. Possibly try to get the tests in
zubhub_backend/zubhub/creators/tests/test_views.py
to pass.