Skip to content

Commit

Permalink
fix: site name limited to 50 characters
Browse files Browse the repository at this point in the history
Before this, building organizations with longer URLs failed since the name field inside Site model has a max_length=50
  • Loading branch information
CodeWithEmad committed Oct 23, 2024
1 parent f36892c commit 8b263c4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tutor/templates/build/openedx/bin/site-configuration
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8b263c4

Please sign in to comment.