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

Revert "feat: add tags to creator registration" #1109

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

NdibeRaymond
Copy link
Collaborator

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.

@yokwejuste
Copy link
Collaborator

Please this should work with @coderatomy new UI the signup

@NdibeRaymond NdibeRaymond merged commit b36bdf1 into master Feb 20, 2024
4 checks passed
@NdibeRaymond
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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', [])
Copy link
Collaborator Author

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',
Copy link
Collaborator Author

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

@NdibeRaymond
Copy link
Collaborator Author

NdibeRaymond commented Feb 20, 2024

from the reviews above, you can see that you are mixing the creator_tags field. Treating it as an array in one place and treating it as string in others

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants