From 8b263c449b0d11fa4ee156108e56f4f366dd11ec Mon Sep 17 00:00:00 2001 From: Emad Rad Date: Wed, 23 Oct 2024 16:23:09 +0330 Subject: [PATCH] fix: site name limited to 50 characters Before this, building organizations with longer URLs failed since the name field inside Site model has a max_length=50 --- tutor/templates/build/openedx/bin/site-configuration | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tutor/templates/build/openedx/bin/site-configuration b/tutor/templates/build/openedx/bin/site-configuration index 32736d561a..22e7788e77 100644 --- a/tutor/templates/build/openedx/bin/site-configuration +++ b/tutor/templates/build/openedx/bin/site-configuration @@ -60,7 +60,9 @@ def get_site_configuration(domain): domain = domain or settings.LMS_BASE site, site_created = Site.objects.get_or_create(domain=domain) if site_created: - site.name = domain + # Limit the site name to 50 characters + # https://github.com/django/django/blob/4.2.16/django/contrib/sites/models.py#L86 + site.name = domain[:50] site.save() configuration, configuration_created = SiteConfiguration.objects.get_or_create(site=site) if configuration_created: