diff --git a/django_project/cloud_native_gis/admin/layer.py b/django_project/cloud_native_gis/admin/layer.py index 614f461..646caff 100644 --- a/django_project/cloud_native_gis/admin/layer.py +++ b/django_project/cloud_native_gis/admin/layer.py @@ -29,11 +29,13 @@ def start_upload_data(modeladmin, request, queryset): import_data.delay(layer.pk) +@admin.register(Layer) class LayerAdmin(admin.ModelAdmin): """Layer admin.""" list_display = ( - 'unique_id', 'name', 'created_by', 'created_at', 'tile_url', 'editor' + 'unique_id', 'name', 'created_by', 'created_at', + 'is_ready', 'tile_url', 'editor' ) form = LayerForm inlines = [LayerAttributeInline] @@ -60,6 +62,8 @@ def field_names(self, obj: Layer): def editor(self, obj: Layer): """Return fields.""" + if not obj.tile_url: + return None return mark_safe( f"