feat(models/pages.py): add repository_url field to CoursePage

This commit is contained in:
2026-03-23 13:45:17 +01:00
parent a918ee73c4
commit cb19bc6262

View File

@@ -66,6 +66,11 @@ class CoursePage(Page):
help_text="Additional groups that should have access to this course, e.g. Editors. NOTE: Users who purchase the course will be automatically added to a dedicated access group for this course, so you don't need to add that group here.", help_text="Additional groups that should have access to this course, e.g. Editors. NOTE: Users who purchase the course will be automatically added to a dedicated access group for this course, so you don't need to add that group here.",
) )
repository_url = models.URLField(
null=True,
blank=True,
)
def _user_has_access(self, user): def _user_has_access(self, user):
if not user.is_authenticated: if not user.is_authenticated:
return False return False
@@ -124,6 +129,11 @@ class CoursePage(Page):
FieldPanel("description"), FieldPanel("description"),
FieldPanel("body"), FieldPanel("body"),
FieldPanel("allowed_groups", widget=CheckboxSelectMultiple), FieldPanel("allowed_groups", widget=CheckboxSelectMultiple),
FieldPanel(
"repository_url",
read_only=True,
heading="Repository URL (auto-generated)",
),
] ]
parent_page_types = ["home.CourseIndexPage"] parent_page_types = ["home.CourseIndexPage"]
subpage_types = ["home.CourseModulePage"] subpage_types = ["home.CourseModulePage"]