@@ -43,12 +43,10 @@ <h1 class="title">Module <code>supertokens_python.recipe.emailpassword.api.signu
4343
4444from typing import TYPE_CHECKING, Any
4545
46- from ..exceptions import raise_form_field_exception
47- from supertokens_python.recipe.emailpassword.interfaces import (
48- SignUpOkResult,
49- SignUpPostEmailAlreadyExistsError,
50- )
46+ from supertokens_python.recipe.emailpassword.interfaces import SignUpPostOkResult
5147from supertokens_python.types import GeneralErrorResponse
48+
49+ from ..exceptions import raise_form_field_exception
5250from ..types import ErrorFormField
5351
5452if TYPE_CHECKING:
@@ -79,20 +77,20 @@ <h1 class="title">Module <code>supertokens_python.recipe.emailpassword.api.signu
7977 form_fields, api_options, user_context
8078 )
8179
82- if isinstance(response, SignUpOkResult ):
80+ if isinstance(response, SignUpPostOkResult ):
8381 return send_200_response(response.to_json(), api_options.response)
8482 if isinstance(response, GeneralErrorResponse):
8583 return send_200_response(response.to_json(), api_options.response)
86- if isinstance(response, SignUpPostEmailAlreadyExistsError):
87- return raise_form_field_exception(
88- "EMAIL_ALREADY_EXISTS_ERROR",
89- [
90- ErrorFormField(
91- id="email",
92- error="This email already exists. Please sign in instead.",
93- )
94- ],
95- )</ code > </ pre >
84+
85+ return raise_form_field_exception(
86+ "EMAIL_ALREADY_EXISTS_ERROR",
87+ [
88+ ErrorFormField(
89+ id="email",
90+ error="This email already exists. Please sign in instead.",
91+ )
92+ ],
93+ )</ code > </ pre >
9694</ details >
9795</ section >
9896< section >
@@ -127,20 +125,20 @@ <h2 class="section-title" id="header-functions">Functions</h2>
127125 form_fields, api_options, user_context
128126 )
129127
130- if isinstance(response, SignUpOkResult ):
128+ if isinstance(response, SignUpPostOkResult ):
131129 return send_200_response(response.to_json(), api_options.response)
132130 if isinstance(response, GeneralErrorResponse):
133131 return send_200_response(response.to_json(), api_options.response)
134- if isinstance(response, SignUpPostEmailAlreadyExistsError):
135- return raise_form_field_exception(
136- "EMAIL_ALREADY_EXISTS_ERROR",
137- [
138- ErrorFormField(
139- id="email",
140- error="This email already exists. Please sign in instead.",
141- )
142- ],
143- )</ code > </ pre >
132+
133+ return raise_form_field_exception(
134+ "EMAIL_ALREADY_EXISTS_ERROR",
135+ [
136+ ErrorFormField(
137+ id="email",
138+ error="This email already exists. Please sign in instead.",
139+ )
140+ ],
141+ )</ code > </ pre >
144142</ details >
145143</ dd >
146144</ dl >
0 commit comments