Skip to content

Commit

Permalink
✨ [#4969] Ensure map tile layers are loaded on deploy
Browse files Browse the repository at this point in the history
Set up a post-migrate hook to load the map tile layers fixture.
  • Loading branch information
sergei-maertens committed Jan 2, 2025
1 parent c135dd4 commit 4d9b8ea
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/openforms/config/apps.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
from io import StringIO

from django.apps import AppConfig
from django.core.management import call_command
from django.db.models.signals import post_migrate
from django.dispatch import receiver


class OpenFormsConfigConfig(AppConfig):
name = "openforms.config"
verbose_name = "Configuration"


@receiver(post_migrate, dispatch_uid="load_default_map_tile_layers")
def update_map_tile_layers(sender, **kwargs):
call_command("loaddata", "default_map_tile_layers", verbosity=0, stdout=StringIO())

0 comments on commit 4d9b8ea

Please sign in to comment.