Commit 328f755d authored by JB's avatar JB

pretty observer name instead of created_by name

parent 4c2da75e
......@@ -115,6 +115,15 @@ class Profile(AbstractBaseUser, PermissionsMixin):
"Returns the short name for the user."
return self.first_name
def name_pretty(self):
"If lastname exists, return firstname initial and lastname. Else return username."
if self.last_name :
first=self.first_name or ' '
return '{} {}'.format(first[0]+'.',self.last_name).strip(' .')
else :
return self.username
def __str__(self):
return self.username
......@@ -1375,7 +1375,7 @@ class SightingTable(tables.Table):
fields = (
'id','actions', 'common_name_fr', 'sci_name','sp_true', 'total_count', 'breed_colo', 'session', 'study', 'session.date_start',
'period', '', 'place', 'placetype', 'municipality','export_placetype', 'export_municipality', 'export_territory', 'export_x', 'export_y',
'created_by', 'comment', 'export_comment')
'observer.name_pretty', 'comment', 'export_comment')
class SightingExportTable(tables.Table):
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment