add migration for setting

This commit is contained in:
Richard Schreiber
2026-07-01 10:37:36 +02:00
parent ed432fefad
commit 5de7824b66
4 changed files with 22 additions and 4 deletions
@@ -0,0 +1,18 @@
# Generated by Django 5.2.12 on 2026-07-01 08:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("pretixbase", "0301_reusablemedium_remove_orderposition"),
]
operations = [
migrations.AddField(
model_name="customerssoprovider",
name="allow_convert_to_sso",
field=models.BooleanField(default=False),
),
]
+1 -1
View File
@@ -79,7 +79,7 @@ class CustomerSSOProvider(LoggedModel):
help_text=_(
"If enabled, when an existing customer registered with email and password tries to login through this SSO provider, pretix changes the account to single-sign-on. Otherwise pretix does not allow to log in."
),
),
)
configuration = models.JSONField()
def allow_delete(self):
+1 -1
View File
@@ -1244,7 +1244,7 @@ class SSOProviderForm(I18nModelForm):
class Meta:
model = CustomerSSOProvider
fields = ['is_active', 'name', 'button_label', 'method']
fields = ['is_active', 'name', 'button_label', 'method', 'allow_convert_to_sso']
widgets = {
'method': forms.RadioSelect,
}
+2 -2
View File
@@ -441,9 +441,9 @@ def test_org_sso_login_new_customer_email_conflict(env, client, provider):
@pytest.mark.django_db(transaction=True)
def test_org_sso_convert_customer_on_login(env, client, provider):
organizer = env[0]
provider.allow_convert_to_sso = True
provider.save()
with scopes_disabled():
provider.allow_convert_to_sso = True
provider.save()
customer = organizer.customers.create(email='new@example.net', is_verified=True, is_active=False)
customer.set_password('foo')
customer.save()