Skip to content

Commit

Permalink
Item.tax_rate should not be nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelm committed Feb 11, 2016
1 parent febf352 commit 640fc5f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
22 changes: 22 additions & 0 deletions src/pretix/base/migrations/0007_auto_20160211_1710.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-02-11 17:10
from __future__ import unicode_literals

from decimal import Decimal

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('pretixbase', '0006_auto_20160211_1630'),
]

operations = [
migrations.AlterField(
model_name='item',
name='tax_rate',
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=7, verbose_name='Taxes included in percent'),
),
]
5 changes: 3 additions & 2 deletions src/pretix/base/models/items.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys
from datetime import datetime
from decimal import Decimal

from django.db import models
from django.db.models import Q, Case, Count, Sum, When
Expand Down Expand Up @@ -132,9 +133,9 @@ class Item(LoggedModel):
max_digits=7, decimal_places=2, null=True
)
tax_rate = models.DecimalField(
null=True, blank=True,
verbose_name=_("Taxes included in percent"),
max_digits=7, decimal_places=2
max_digits=7, decimal_places=2,
default=Decimal('0.00')
)
admission = models.BooleanField(
verbose_name=_("Is an admission ticket"),
Expand Down

0 comments on commit 640fc5f

Please sign in to comment.