Permalink
Browse files

do not throw AttributeError in method show_title of positon admin if …

…target obj has not title attr
  • Loading branch information...
1 parent ac934a2 commit 9e09ebd5459679477b71d5b239f5ab465e050918 @MichalMaM MichalMaM committed Feb 21, 2014
Showing with 4 additions and 1 deletion.
  1. +4 −1 ella/positions/admin.py
@@ -10,7 +10,10 @@ def show_title(self, obj):
if not obj.target:
return '-- %s --' % ugettext('empty position')
else:
- return u'%s [%s]' % (obj.target.title, ugettext(obj.target_ct.name),)
+ return u'%s [%s]' % (
+ getattr(obj.target, 'title', obj.target),
+ ugettext(obj.target_ct.name),
+ )
show_title.short_description = _('Title')
def is_filled(self, obj):

0 comments on commit 9e09ebd

Please sign in to comment.