mirror of
https://github.com/pretix/pretix.git
synced 2026-08-08 10:27:49 +00:00
add migration for setting
This commit is contained in:
@@ -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),
|
||||
),
|
||||
]
|
||||
@@ -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):
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user