mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-23 14:59:36 +02:00
chore: Fix null values for adventure date and end date in Transportation model
This commit is contained in:
parent
6fea57d773
commit
d5814fe6df
1 changed files with 1 additions and 2 deletions
|
@ -117,8 +117,7 @@ class Transportation(models.Model):
|
||||||
print(self.date)
|
print(self.date)
|
||||||
if self.date and self.end_date and self.date > self.end_date:
|
if self.date and self.end_date and self.date > self.end_date:
|
||||||
raise ValidationError('The start date must be before the end date. Start date: ' + str(self.date) + ' End date: ' + str(self.end_date))
|
raise ValidationError('The start date must be before the end date. Start date: ' + str(self.date) + ' End date: ' + str(self.end_date))
|
||||||
if self.end_date and self.date is 'null':
|
|
||||||
raise ValidationError('Transportations must have an end date. Transportation: ' + self.name)
|
|
||||||
if self.collection:
|
if self.collection:
|
||||||
if self.collection.is_public and not self.is_public:
|
if self.collection.is_public and not self.is_public:
|
||||||
raise ValidationError('Transportations associated with a public collection must be public. Collection: ' + self.collection.name + ' Transportation: ' + self.name)
|
raise ValidationError('Transportations associated with a public collection must be public. Collection: ' + self.collection.name + ' Transportation: ' + self.name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue