Add __str__ to models, remove null=True in CharField and TextField
This commit is contained in:
parent
4a9c37905c
commit
53c4e38771
14 changed files with 168 additions and 15 deletions
|
|
@ -70,8 +70,8 @@ class Note(PolymorphicModel):
|
|||
"It can be reactivated at any time.")),
|
||||
('forced', _("The note is blocked by the the BDE and can't be manually reactivated.")),
|
||||
],
|
||||
null=True,
|
||||
default=None,
|
||||
blank=True,
|
||||
default="",
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
|
|
|||
|
|
@ -90,6 +90,9 @@ class TransactionTemplate(models.Model):
|
|||
def get_absolute_url(self):
|
||||
return reverse('note:template_update', args=(self.pk,))
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class Transaction(PolymorphicModel):
|
||||
"""
|
||||
|
|
@ -150,8 +153,7 @@ class Transaction(PolymorphicModel):
|
|||
invalidity_reason = models.CharField(
|
||||
verbose_name=_('invalidity reason'),
|
||||
max_length=255,
|
||||
default=None,
|
||||
null=True,
|
||||
default='',
|
||||
blank=True,
|
||||
)
|
||||
|
||||
|
|
@ -195,7 +197,7 @@ class Transaction(PolymorphicModel):
|
|||
|
||||
# When a transaction is declared valid, we ensure that the invalidity reason is null, if it was
|
||||
# previously invalid
|
||||
self.invalidity_reason = None
|
||||
self.invalidity_reason = ""
|
||||
|
||||
if source_balance > 9223372036854775807 or source_balance < -9223372036854775808\
|
||||
or dest_balance > 9223372036854775807 or dest_balance < -9223372036854775808:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue