From: Guillaume Pellerin Date: Thu, 24 Sep 2015 21:03:21 +0000 (+0200) Subject: bugfix X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=b8087336d52f819d2c124c51003be5aaee72073a;p=diggersdigest.git bugfix --- diff --git a/app/records/admin.py b/app/records/admin.py index a9612ad..846d5a2 100644 --- a/app/records/admin.py +++ b/app/records/admin.py @@ -28,7 +28,7 @@ from .models import ConditionGrading class RecordInline(admin.StackedInline): model = Record extra = 0 - max_num = 0 + max_num = 1 list_display = ProductAdmin.list_display list_display.remove("sale_price") diff --git a/app/records/models.py b/app/records/models.py index 0acbd93..48faf49 100644 --- a/app/records/models.py +++ b/app/records/models.py @@ -239,14 +239,14 @@ class Record(models.Model): YEAR_CHOICES = [(y, y) for y in range(YEAR_START, YEAR_STOP)] DECADE_CHOICES = [(d, str(d)+'s') for d in range (DECADE_START, YEAR_STOP, 10)] - title = models.CharField(max_length=128) + title = models.CharField(max_length=128, blank=True) artist = models.ForeignKey(Artist, verbose_name=_('artist'), related_name='records_artists', null=True, on_delete=models.SET_NULL) performers = models.ManyToManyField(Artist, verbose_name=_('performers'), related_name='records_performers', blank=True) record_status = models.IntegerField(_('record status'), choices=NOVELTY_CHOICES, default=NEW) label = models.ForeignKey(Label, verbose_name=_('label'), related_name='records', null=True, on_delete=models.SET_NULL) release_year = models.IntegerField(_('release year'), null=True, choices=YEAR_CHOICES) release_decade = models.IntegerField(_('release decade'), null=True, choices=DECADE_CHOICES) - date_text = models.CharField(_('date text'), max_length=8, null=True) + date_text = models.CharField(_('date text'), max_length=8, blank=True) country = models.ForeignKey(Country, verbose_name=_('country'), related_name='records', null=True, on_delete=models.SET_NULL) cover_condition = models.ForeignKey(ConditionGrading, verbose_name=_('cover condition'), related_name='records_cover_condition', null=True, on_delete=models.SET_NULL) vinyl_condition = models.ForeignKey(ConditionGrading, verbose_name=_('vinyl condition'), related_name='records_vinyl_condition', null=True, on_delete=models.SET_NULL)