Skip to content
Snippets Groups Projects
Commit 34d456a8 authored by jarmil's avatar jarmil
Browse files

REF: mswebs: prejmenovano pirate_id

parent ce2bc034
No related branches found
No related tags found
No related merge requests found
# 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",
),
]
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment