core: add slug to application

This commit is contained in:
Jens Langhammer 2018-12-26 17:17:39 +01:00
parent 7178468135
commit 2eae37107d
No known key found for this signature in database
GPG key ID: BEBC05297D92821B
3 changed files with 22 additions and 1 deletions

View file

@ -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(),

View file

@ -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,
),
]

View file

@ -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,