From 2eae37107d209554fce26aa3ca63b08b409f4156 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 26 Dec 2018 17:17:39 +0100 Subject: [PATCH] core: add slug to application --- passbook/core/forms/applications.py | 3 ++- .../core/migrations/0004_application_slug.py | 19 +++++++++++++++++++ passbook/core/models.py | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 passbook/core/migrations/0004_application_slug.py diff --git a/passbook/core/forms/applications.py b/passbook/core/forms/applications.py index 17cd4ab41..4a7d50712 100644 --- a/passbook/core/forms/applications.py +++ b/passbook/core/forms/applications.py @@ -12,7 +12,8 @@ class ApplicationForm(forms.ModelForm): class Meta: model = Application - fields = ['name', 'launch_url', 'icon_url', 'rules', 'provider', 'skip_authorization'] + fields = ['name', 'slug', 'launch_url', 'icon_url', + 'rules', 'provider', 'skip_authorization'] widgets = { 'name': forms.TextInput(), 'launch_url': forms.TextInput(), diff --git a/passbook/core/migrations/0004_application_slug.py b/passbook/core/migrations/0004_application_slug.py new file mode 100644 index 000000000..a7ce4477d --- /dev/null +++ b/passbook/core/migrations/0004_application_slug.py @@ -0,0 +1,19 @@ +# Generated by Django 2.1.4 on 2018-12-26 15:52 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('passbook_core', '0003_invite'), + ] + + operations = [ + migrations.AddField( + model_name='application', + name='slug', + field=models.SlugField(default=''), + preserve_default=False, + ), + ] diff --git a/passbook/core/models.py b/passbook/core/models.py index 6c8733eaa..ca2e3ff48 100644 --- a/passbook/core/models.py +++ b/passbook/core/models.py @@ -55,6 +55,7 @@ class Application(RuleModel): add custom fields and other properties""" name = models.TextField() + slug = models.SlugField() launch_url = models.URLField(null=True, blank=True) icon_url = models.TextField(null=True, blank=True) provider = models.OneToOneField('Provider', null=True,