forked from GithubBackups/healthchecks
Project.badge_key must be not null and unique.
This commit is contained in:
parent
d102f10a2d
commit
b5df5b3c6e
18
hc/accounts/migrations/0021_auto_20190112_2005.py
Normal file
18
hc/accounts/migrations/0021_auto_20190112_2005.py
Normal file
@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.1.5 on 2019-01-12 20:05
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0020_auto_20190112_1950'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='project',
|
||||
name='badge_key',
|
||||
field=models.CharField(max_length=150, unique=True),
|
||||
),
|
||||
]
|
@ -240,7 +240,7 @@ class Project(models.Model):
|
||||
owner = models.ForeignKey(User, models.CASCADE)
|
||||
api_key = models.CharField(max_length=128, blank=True)
|
||||
api_key_readonly = models.CharField(max_length=128, blank=True)
|
||||
badge_key = models.CharField(max_length=150, blank=True, null=True)
|
||||
badge_key = models.CharField(max_length=150, unique=True)
|
||||
|
||||
|
||||
class Member(models.Model):
|
||||
|
@ -15,6 +15,7 @@ class BaseTestCase(TestCase):
|
||||
self.alice.save()
|
||||
|
||||
self.project = Project(owner=self.alice, api_key="X" * 32)
|
||||
self.project.badge_key = self.alice.username
|
||||
self.project.save()
|
||||
|
||||
self.profile = Profile(user=self.alice, api_key="X" * 32)
|
||||
@ -28,6 +29,7 @@ class BaseTestCase(TestCase):
|
||||
self.bob.save()
|
||||
|
||||
self.bobs_project = Project(owner=self.bob)
|
||||
self.bobs_project.badge_key = self.bob.username
|
||||
self.bobs_project.save()
|
||||
|
||||
self.bobs_profile = Profile(user=self.bob)
|
||||
|
Loading…
x
Reference in New Issue
Block a user