@@ -43,9 +43,6 @@ class RegisterView(CreateAPIView):
43
43
44
44
Register a new user to the system.
45
45
The data required are username, email, name, password and mobile (optional).
46
-
47
- Author: Himanshu Shankar (https://himanshus.com)
48
- Aditya Gupta (https://github.com/ag93999)
49
46
"""
50
47
51
48
renderer_classes = (JSONRenderer ,)
@@ -77,9 +74,6 @@ class LoginView(APIView):
77
74
78
75
username -- Either username or mobile or email address.
79
76
password -- Password of the user.
80
-
81
- Author: Himanshu Shankar (https://himanshus.com)
82
- Aditya Gupta (https://github.com/ag93999)
83
77
"""
84
78
85
79
renderer_classes = (JSONRenderer ,)
@@ -126,9 +120,6 @@ class CheckUniqueView(APIView):
126
120
doesn't exists yet)
127
121
'prop' -- A property to check for uniqueness (username/email/mobile)
128
122
'value' -- Value against property which is to be checked for.
129
-
130
- Author: Himanshu Shankar (https://himanshus.com)
131
- Aditya Gupta (https://github.com/ag93999)
132
123
"""
133
124
134
125
renderer_classes = (JSONRenderer ,)
@@ -187,9 +178,6 @@ class OTPView(APIView):
187
178
188
179
>>> {"destination": "[email protected] ", "is_login": True,
189
180
>>> "verify_otp": 1234232}
190
-
191
- Author: Himanshu Shankar (https://himanshus.com)
192
- Aditya Gupta (https://github.com/ag93999)
193
181
"""
194
182
195
183
permission_classes = (AllowAny ,)
@@ -243,9 +231,6 @@ class RetrieveUpdateUserAccountView(RetrieveUpdateAPIView):
243
231
get: Fetch Account Details
244
232
put: Update all details
245
233
patch: Update some details
246
-
247
- Author: Himanshu Shankar (https://himanshus.com)
248
- Aditya Gupta( https://github.com/ag93999)
249
234
"""
250
235
251
236
queryset = User .objects .all ()
@@ -264,7 +249,7 @@ def update(self, request, *args, **kwargs):
264
249
response = super (RetrieveUpdateUserAccountView , self ).update (
265
250
request , * args , ** kwargs
266
251
)
267
- # we need to set_password after save the user otherwise it'll save the raw_password in db.
252
+ # we need to set_password after save the user otherwise it'll save the raw_password in db. # noqa
268
253
if "password" in request .data .keys ():
269
254
self .request .user .set_password (request .data ["password" ])
270
255
self .request .user .save ()
@@ -286,9 +271,6 @@ class OTPLoginView(APIView):
286
271
email -- Required
287
272
mobile -- Required
288
273
verify_otp -- Not Required (only when verifying OTP)
289
-
290
- Author: Himanshu Shankar (https://himanshus.com)
291
- Aditya Gupta (https://github.com/ag93999)
292
274
"""
293
275
294
276
permission_classes = (AllowAny ,)
@@ -341,7 +323,9 @@ def post(self, request, *args, **kwargs):
341
323
otp_obj_email .save ()
342
324
message ["email" ] = {"otp" : _ ("OTP has been sent successfully." )}
343
325
else :
344
- message ["email" ] = {"otp" : _ (f'OTP sending failed { sentotp_email ["message" ]} ' )}
326
+ message ["email" ] = {
327
+ "otp" : _ (f'OTP sending failed { sentotp_email ["message" ]} ' )
328
+ }
345
329
346
330
if sentotp_mobile ["success" ]:
347
331
otp_obj_mobile .send_counter += 1
@@ -352,7 +336,6 @@ def post(self, request, *args, **kwargs):
352
336
"otp" : _ (f'OTP sending failed { sentotp_mobile ["message" ]} ' )
353
337
}
354
338
355
-
356
339
if sentotp_email ["success" ] or sentotp_mobile ["success" ]:
357
340
curr_status = status .HTTP_201_CREATED
358
341
else :
0 commit comments