Skip to content

Commit

Permalink
Merge pull request #6472 from escattone/fix-restrict-to-groups-2148
Browse files Browse the repository at this point in the history
ensure that `restrict_to_groups` field is not required
  • Loading branch information
akatsoulas authored Jan 28, 2025
2 parents 73ae7d0 + 3084751 commit d915bc8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
21 changes: 21 additions & 0 deletions kitsune/wiki/migrations/0018_alter_document_restrict_to_groups.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.18 on 2025-01-27 13:49

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("auth", "0012_alter_user_first_name_max_length"),
("wiki", "0017_alter_document_tags"),
]

operations = [
migrations.AlterField(
model_name="document",
name="restrict_to_groups",
field=models.ManyToManyField(
blank=True, related_name="restricted_documents", to="auth.group"
),
),
]
4 changes: 3 additions & 1 deletion kitsune/wiki/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ class Document(NotificationsMixin, ModelBase, DocumentPermissionMixin):
# Is this document localizable or not?
is_localizable = models.BooleanField(default=True, db_index=True)

restrict_to_groups = models.ManyToManyField(Group, related_name="restricted_documents")
restrict_to_groups = models.ManyToManyField(
Group, blank=True, related_name="restricted_documents"
)

# TODO: validate (against settings.SUMO_LANGUAGES?)
locale = LocaleField(default=settings.WIKI_DEFAULT_LANGUAGE, db_index=True)
Expand Down

0 comments on commit d915bc8

Please sign in to comment.