Skip to content

Commit

Permalink
🐛 Fix default_groups being linked to the wrong model field
Browse files Browse the repository at this point in the history
and set the default as an empty list
  • Loading branch information
stevenbal committed Jan 10, 2025
1 parent 084362e commit 12dd96f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.2.17 on 2025-01-10 15:20

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("auth", "0012_alter_user_first_name_max_length"),
("mozilla_django_oidc_db", "0005_alter_openidconnectconfig_claim_mapping"),
]

operations = [
migrations.AlterField(
model_name="openidconnectconfig",
name="default_groups",
field=models.ManyToManyField(
blank=True,
default=list,
help_text="The default groups to which every user logging in with OIDC will be assigned",
to="auth.group",
verbose_name="default groups",
),
),
]
1 change: 1 addition & 0 deletions mozilla_django_oidc_db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ class OpenIDConnectConfig(OpenIDConnectConfigBase):
default_groups = models.ManyToManyField(
Group,
verbose_name=_("default groups"),
default=list,
blank=True,
help_text=_(
"The default groups to which every user logging in with OIDC will be assigned"
Expand Down
4 changes: 1 addition & 3 deletions mozilla_django_oidc_db/setup_configuration/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ class AdminOIDCConfigurationModelItem(ConfigurationModel):
superuser_group_names: list[str] = DjangoModelRef(
OpenIDConnectConfig, "superuser_group_names"
)
default_groups: list[str] = DjangoModelRef(
OpenIDConnectConfig, "superuser_group_names"
)
default_groups: list[str] = DjangoModelRef(OpenIDConnectConfig, "default_groups")
oidc_rp_scopes_list: list[str] = DjangoModelRef(
OpenIDConnectConfig, "oidc_rp_scopes_list"
)
Expand Down

0 comments on commit 12dd96f

Please sign in to comment.