Skip to content

Commit

Permalink
Exit gracefully if site does not exist on RA (#11548)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonatan-lopes authored Dec 19, 2023
1 parent 15e6554 commit f811e29
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions network-api/networkapi/management/commands/review_app_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,14 @@ def update_site_hostnames(self):
"""Find the relevant sites in Wagtail and update their hostnames to the new domains"""
domain_site_mapping = self.get_domain_site_mapping()
for site_name, domain in domain_site_mapping.items():
site = Site.objects.get(site_name=site_name)
site.hostname = domain
site.port = 80
site.save()
try:
site = Site.objects.get(site_name=site_name)
site.hostname = domain
site.port = 80
site.save()
except Site.DoesNotExist:
# If the site doesn't exist (wasn't created yet), we don't need to update it
pass

def add_arguments(self, parser):
parser.add_argument("action", type=str)
Expand Down

0 comments on commit f811e29

Please sign in to comment.