diff --git a/shared/migrations/0013_auto_20201104_1053.py b/shared/migrations/0013_auto_20201104_1053.py new file mode 100644 index 0000000000000000000000000000000000000000..92f5df8ec9824ef9fd34fccc7829926b93758803 --- /dev/null +++ b/shared/migrations/0013_auto_20201104_1053.py @@ -0,0 +1,16 @@ +# Generated by Django 3.1.1 on 2020-11-04 09:53 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("shared", "0012_article_date"), + ] + + operations = [ + migrations.RenameField( + model_name="personpage", old_name="pirate_id", new_name="username", + ), + ] diff --git a/shared/models.py b/shared/models.py index d5a27e159e10626afc3c7e3848627e5f2a7123ac..316316f19e20030b64079d2a79264d96135cd5ec 100644 --- a/shared/models.py +++ b/shared/models.py @@ -84,7 +84,7 @@ class PersonPage(SharedSubpageMixin, MetadataPageMixin, Page): """ # ve formatu iapi: https://iapi.pirati.cz/v1/user?username=john.doe - pirate_id = models.TextField("Pirate ID osoby", blank=False) + username = models.TextField("Pirate ID osoby", blank=False) profile_id = models.IntegerField( "ÄŚĂslo medailonku (0..2) z lide.pirati.cz", blank=True, @@ -95,7 +95,7 @@ class PersonPage(SharedSubpageMixin, MetadataPageMixin, Page): perex = models.TextField("Perex osoby", blank=True) content_panels = Page.content_panels + [ - FieldPanel("pirate_id"), + FieldPanel("username"), FieldPanel("profile_id"), FieldPanel("perex"), ] @@ -103,7 +103,7 @@ class PersonPage(SharedSubpageMixin, MetadataPageMixin, Page): def _iapi(self): """ Vrati data o osobe z piratskeho IAPI jako json. Cached via requests_cache """ return requests.get( - "https://iapi.pirati.cz/v1/user?username=%s" % self.pirate_id + "https://iapi.pirati.cz/v1/user?username=%s" % self.username ).json() @property