Merge pull request #1772 from umap-project/remove-description

feat: remove Map.description
This commit is contained in:
Yohan Boniface 2024-04-24 21:09:26 +02:00 committed by GitHub
commit e817f1cb0e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 1 deletions

View file

@ -0,0 +1,16 @@
# Generated by Django 5.0.4 on 2024-04-24 07:50
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("umap", "0020_alter_tilelayer_url_template"),
]
operations = [
migrations.RemoveField(
model_name="map",
name="description",
),
]

View file

@ -155,7 +155,6 @@ class Map(NamedModel):
(BLOCKED, _("Blocked")),
)
slug = models.SlugField(db_index=True)
description = models.TextField(blank=True, null=True, verbose_name=_("description"))
center = models.PointField(geography=True, verbose_name=_("center"))
zoom = models.IntegerField(default=7, verbose_name=_("zoom"))
locate = models.BooleanField(
@ -198,6 +197,13 @@ class Map(NamedModel):
objects = models.Manager()
public = PublicManager()
@property
def description(self):
try:
return self.settings["properties"]["description"]
except KeyError:
return ""
@property
def preview_settings(self):
layers = self.datalayer_set.all()