Handle NoneType to str
This commit is contained in:
parent
827834dc0e
commit
05b2fa770c
1 changed files with 2 additions and 2 deletions
|
@ -127,12 +127,12 @@ class Range(models.Model):
|
|||
db_table = 'range'
|
||||
|
||||
def __str__(self):
|
||||
return self.range_name if self else '--'
|
||||
return self.range_name if self and self.range_name else '--'
|
||||
|
||||
def dict(self):
|
||||
return {
|
||||
'id': self.id,
|
||||
'name': self.name,
|
||||
'name': self.range_name,
|
||||
'gmba_id': self.gmba_id,
|
||||
'countries': self.countries,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue