diff --git a/billard/admin.py b/billard/admin.py index b6456d7..f3d142e 100644 --- a/billard/admin.py +++ b/billard/admin.py @@ -26,7 +26,7 @@ class DeskAdminForm(forms.ModelForm): def clean_desk_no(self): id = self.instance.id - client = self.instance.client + client = self.cleaned_data['client'] desk_no = self.cleaned_data['desk_no'] t = Desk.objects.filter(desk_no=desk_no, client=client).exclude(id=id) if t.count() > 0: diff --git a/billard/migrations/0014_auto_20170211_2008.py b/billard/migrations/0014_auto_20170211_2008.py new file mode 100644 index 0000000..e4d4d98 --- /dev/null +++ b/billard/migrations/0014_auto_20170211_2008.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2017-02-11 20:08 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('billard', '0013_accounting'), + ] + + operations = [ + migrations.AlterField( + model_name='desk', + name='prize', + field=models.DecimalField(decimal_places=2, default=0.0, max_digits=5, verbose_name='Normelpreis'), + ), + ] diff --git a/billard/models.py b/billard/models.py index ae6d4ac..7b8c7fa 100644 --- a/billard/models.py +++ b/billard/models.py @@ -63,7 +63,7 @@ class Desk(models.Model): desk_no = models.IntegerField(verbose_name='Tischnummer') name = models.CharField(max_length=32, blank=True, null=True, verbose_name='Tischbezeichnung') enabled = models.BooleanField(verbose_name='Tisch aktiv') - prize = models.DecimalField(max_digits=5, decimal_places=2, blank=True, null=True, verbose_name="Normelpreis") + prize = models.DecimalField(max_digits=5, decimal_places=2, default=0.0, verbose_name="Normelpreis") prize_hh = models.DecimalField(max_digits=5, decimal_places=2, blank=True, null=True, verbose_name="Preis Happy Hour")