Skip to content

Commit 42028b1

Browse files
committed
Trying to fix stupid tilda field names
1 parent 2c6498d commit 42028b1

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

partner_programs/views.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,30 @@ def post(self, request, *args, **kwargs):
7070
return Response(status=status.HTTP_200_OK)
7171
print(data)
7272
user_fields = (
73-
"email",
73+
# "email",
7474
"password",
7575
"first_name",
7676
"last_name",
7777
"patronymic",
7878
"city",
7979
)
80+
# cringe tilda
81+
email = data.get("email")
82+
if not email:
83+
email = data.get("email_")
84+
if not email:
85+
return Response(
86+
data={"detail": "You need to pass an email address."},
87+
status=status.HTTP_400_BAD_REQUEST,
88+
)
89+
8090
# fixme: should we set verification_date?, if no then we need to ad them to ClickUp list
8191
user = User.objects.create(
8292
**{field_name: data[field_name] for field_name in user_fields},
8393
birthday=date_to_iso(data["birthday"]),
8494
is_active=True, # bypass email verification
8595
onboarding_stage=None, # bypass onboarding
96+
email=email,
8697
)
8798

8899
user_profile_program_data = {

0 commit comments

Comments
 (0)