some login fix
This commit is contained in:
parent
41f81b1468
commit
764911df7c
@ -261,7 +261,10 @@ def UserRegisterAPIView(request):
|
||||
@api_view(['POST'])
|
||||
@permission_classes([permissions.AllowAny])
|
||||
def UserActivationAPIView(request, uidb64, token):
|
||||
uid = force_text(urlsafe_base64_decode(uidb64))
|
||||
try:
|
||||
uid = force_text(urlsafe_base64_decode(uidb64))
|
||||
except:
|
||||
return Response({'ok':False, 'error':'Invalid activation link'}, status = status.HTTP_400_BAD_REQUEST)
|
||||
user = User.objects.filter(id = uid)
|
||||
if(user.exists()):
|
||||
user = user.first()
|
||||
@ -332,4 +335,4 @@ def UserLogoutAPIView(request):
|
||||
def async_email_send(mail_subject, message, to_email):
|
||||
mail_to_send = EmailMultiAlternatives(mail_subject, strip_tags(message), to=to_email)
|
||||
mail_to_send.attach_alternative(message, 'text/html')
|
||||
mail_to_send.send()
|
||||
mail_to_send.send()
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% autoescape off %}
|
||||
<h1>HI {{ user.username }}</h1>
|
||||
<h2>Please click on the link to confirm your registration:</h2>
|
||||
<a href="http://{{ domain }}/activate/{{ uidb64 }}/{{ token }}"><h2>Confirm Email</h2></a>
|
||||
{% endautoescape %}
|
||||
<a href="http://{{ domain }}:8888/activate/?uidb={{ uidb64 }}&token={{ token }}"><h2>Confirm Email</h2></a>
|
||||
{% endautoescape %}
|
||||
|
@ -2,5 +2,5 @@
|
||||
<h1>HI {{ user.username }}</h1>
|
||||
<h2>This email was used to reset your account password</h2>
|
||||
<h2>To reset password follow the link below:</h2>
|
||||
<a href="http://{{ domain }}/reset_pass/{{ uidb64 }}/{{ token }}"><h2>Reset Password</h2></a>
|
||||
{% endautoescape %}
|
||||
<a href="http://{{ domain }}:8888/reset_pass/{{ uidb64 }}/{{ token }}"><h2>Reset Password</h2></a>
|
||||
{% endautoescape %}
|
||||
|
7457
front/package-lock.json
generated
Normal file
7457
front/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user