Skip to content
Snippets Groups Projects
Commit 4e2a19d5 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Django3 compatibility

parent d201da12
No related branches found
No related tags found
No related merge requests found
Pipeline #26630 failed
...@@ -3,30 +3,67 @@ image: docker:latest ...@@ -3,30 +3,67 @@ image: docker:latest
stages: stages:
- test - test
test35: test35-django2:
stage: test stage: test
image: python:3.5 image: python:3.5
script: script:
- pip install 'django<3'
- pip install -r requirements.txt - pip install -r requirements.txt
- coverage run --source='basetheme_bootstrap' manage.py test && coverage report -m - coverage run --source='basetheme_bootstrap' manage.py test && coverage report -m
test36: test36-django2:
stage: test stage: test
image: python:3.6 image: python:3.6
script: script:
- pip install 'django<3'
- pip install -r requirements.txt - pip install -r requirements.txt
- coverage run --source='basetheme_bootstrap' manage.py test && coverage report -m - coverage run --source='basetheme_bootstrap' manage.py test && coverage report -m
test37: test37-django2:
stage: test stage: test
image: python:3.7 image: python:3.7
script: script:
- pip install 'django<3'
- pip install -r requirements.txt - pip install -r requirements.txt
- coverage run --source='basetheme_bootstrap' manage.py test && coverage report -m - coverage run --source='basetheme_bootstrap' manage.py test && coverage report -m
testrc: testrc-django2:
stage: test stage: test
image: python:rc image: python:rc
script: script:
- pip install 'django<3'
- pip install -r requirements.txt
- coverage run --source='basetheme_bootstrap' manage.py test && coverage report -m
test35-django3:
stage: test
image: python:3.5
script:
- pip install 'django>=3'
- pip install -r requirements.txt
- coverage run --source='basetheme_bootstrap' manage.py test && coverage report -m
test36-django3:
stage: test
image: python:3.6
script:
- pip install 'django>=3'
- pip install -r requirements.txt
- coverage run --source='basetheme_bootstrap' manage.py test && coverage report -m
test37-django3:
stage: test
image: python:3.7
script:
- pip install 'django>=3'
- pip install -r requirements.txt
- coverage run --source='basetheme_bootstrap' manage.py test && coverage report -m
testrc-django3:
stage: test
image: python:rc
script:
- pip install 'django>=3'
- pip install -r requirements.txt - pip install -r requirements.txt
- coverage run --source='basetheme_bootstrap' manage.py test && coverage report -m - coverage run --source='basetheme_bootstrap' manage.py test && coverage report -m
\ No newline at end of file
import six
from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.utils import six
class TokenGenerator(PasswordResetTokenGenerator): class TokenGenerator(PasswordResetTokenGenerator):
......
...@@ -111,7 +111,7 @@ def send_account_created(request, user, auto_active=False): ...@@ -111,7 +111,7 @@ def send_account_created(request, user, auto_active=False):
try: try:
activation_link = request.scheme + "://" + request.get_host() activation_link = request.scheme + "://" + request.get_host()
activation_link += reverse('basetheme_bootstrap:activate', kwargs={ activation_link += reverse('basetheme_bootstrap:activate', kwargs={
'uidb64': urlsafe_base64_encode(force_bytes(user.pk)).decode(), 'uidb64': urlsafe_base64_encode(force_bytes(user.pk)),
'token': tokens.account_activation_token.make_token(user) 'token': tokens.account_activation_token.make_token(user)
}) })
if auto_active: if auto_active:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment