json: check polgroup is set before inserting it
This commit is contained in:
parent
6b0daffe17
commit
666489360f
|
@ -10,7 +10,6 @@ class DeputyJson(BrowserView):
|
|||
'lastname': self.context.lastname,
|
||||
'active': self.context.active,
|
||||
'sex': self.context.sex,
|
||||
'polgroup': self.context.polgroup.to_object.title,
|
||||
'district': self.context.district,
|
||||
'birthplace': self.context.birthplace,
|
||||
'bio': self.context.bio,
|
||||
|
@ -18,6 +17,8 @@ class DeputyJson(BrowserView):
|
|||
'degrees': self.context.degrees,
|
||||
'mandates': self.context.mandates,
|
||||
}
|
||||
if self.context.polgroup:
|
||||
d['polgroup'] = self.context.polgroup.to_object.title
|
||||
if self.context.picture:
|
||||
d['picture'] = self.context.absolute_url() + '/photo'
|
||||
if self.context.birthdate:
|
||||
|
|
Reference in New Issue