Fakultas Ilmu Komputer UI

Verified Commit d5a0958f authored by Muhammad Ariq Basyar's avatar Muhammad Ariq Basyar
Browse files

[REFACTOR] fix incompatible code for django 2.2 and python 3

removed .method() method call because now urlsafe_base64_encode returns string not bytes
files:
    - new_rest_api/tests.py
    - new_rest_api/views.py
parent 200593b8
Pipeline #64044 failed with stages
in 6 minutes and 49 seconds
......@@ -122,7 +122,7 @@ class UserTests(APITestCase):
def test_activation_function(self):
user = BisaGoUser.objects.get(phone_number='089892218567').user
uid = urlsafe_base64_encode(force_bytes(user.pk)).decode()
uid = urlsafe_base64_encode(force_bytes(user.pk))
token = account_activation_token.make_token(user)
url = reverse('activate', kwargs={'uidb64' : uid, 'token' : token})
response = self.client.get(url)
......
......@@ -84,7 +84,7 @@ def register_user(request):
message = render_to_string('acc_active_email.html', {
'user' : user,
'domain' : request.get_host,
'uid' : urlsafe_base64_encode(force_bytes(user.pk)).decode(),
'uid' : urlsafe_base64_encode(force_bytes(user.pk)),
'token' : account_activation_token.make_token(user),
})
mail = EmailMessage(mail_subject, message, to=[email])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment