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

[Buxfix] Résolution d’une erreur 400 dans les prévisualisations #157

Merged
merged 1 commit into from
Jun 18, 2024
Merged
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
12 changes: 11 additions & 1 deletion content_manager/management/commands/set_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,19 @@

class Command(BaseCommand):
def handle(self, *args, **kwargs):
"""Sets the site hostname, and imports contents from the config.json file if present"""
"""
Sets the site hostname and site_name,
and imports contents from the config.json file if present.
"""
if "http://" in settings.HOST_URL or "https://" in settings.HOST_URL:
raise ValueError(
"""The HOST_URL environment variable must contain the domain name only,
without the port or http/https protocol."""
)

site = Site.objects.filter(is_default_site=True).first()
site.hostname = settings.HOST_URL
site.site_name = settings.WAGTAIL_SITE_NAME
site.save()

if isfile("config.json"):
Expand Down
Loading