Refactored CSV export logic
This commit is contained in:
@@ -7,7 +7,6 @@ from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from extras.models import CustomFieldModel, CustomFieldValue
|
||||
from utilities.models import CreatedUpdatedModel
|
||||
from utilities.utils import csv_format
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
@@ -53,9 +52,9 @@ class Tenant(CreatedUpdatedModel, CustomFieldModel):
|
||||
return reverse('tenancy:tenant', args=[self.slug])
|
||||
|
||||
def to_csv(self):
|
||||
return csv_format([
|
||||
return (
|
||||
self.name,
|
||||
self.slug,
|
||||
self.group.name if self.group else None,
|
||||
self.description,
|
||||
])
|
||||
)
|
||||
|
Reference in New Issue
Block a user