providers/proxy: fix provider requiring a certificate to be selected

This commit is contained in:
Jens Langhammer 2020-09-14 17:37:06 +02:00
parent 501683e3cb
commit ae6304c05e
4 changed files with 29 additions and 4 deletions

View File

@ -1,7 +1,7 @@
all: lint-fix lint coverage gen
coverage:
coverage run --concurrency=multiprocessing manage.py test --failfast
coverage run --concurrency=multiprocessing manage.py test --failfast -v 3
coverage combine
coverage html
coverage report

View File

@ -139,7 +139,7 @@ stages:
displayName: Run full test suite
inputs:
script: |
pipenv run coverage run ./manage.py test passbook
pipenv run coverage run ./manage.py test passbook -v 3
mkdir output-unittest
mv unittest.xml output-unittest/unittest.xml
mv .coverage output-unittest/coverage
@ -181,7 +181,7 @@ stages:
- task: CmdLine@2
displayName: Run full test suite
inputs:
script: pipenv run coverage run ./manage.py test e2e
script: pipenv run coverage run ./manage.py test e2e -v 3
- task: CmdLine@2
displayName: Prepare unittests and coverage for upload
inputs:

View File

@ -0,0 +1,25 @@
# Generated by Django 3.1.1 on 2020-09-14 15:36
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("passbook_crypto", "0002_create_self_signed_kp"),
("passbook_providers_proxy", "0004_auto_20200913_1947"),
]
operations = [
migrations.AlterField(
model_name="proxyprovider",
name="certificate",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="passbook_crypto.certificatekeypair",
),
),
]

View File

@ -50,7 +50,7 @@ class ProxyProvider(OutpostModel, OAuth2Provider):
cookie_secret = models.TextField(default=get_cookie_secret)
certificate = models.ForeignKey(
CertificateKeyPair, on_delete=models.SET_NULL, null=True
CertificateKeyPair, on_delete=models.SET_NULL, null=True, blank=True,
)
def form(self) -> Type[ModelForm]: