Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: site name limited to 50 characters #1145

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/20241023_155157_codewithemad_long_domain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [Bugfix] Fixed an issue where the site name was not limited to 50 characters when creating a new site configuration. (by @CodeWithEmad)
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
Loading