ncsu-stars / Stars-CMS

A CMS written in Django for the STARS SLC at NCSU
http://research.csc.ncsu.edu/stars
BSD 2-Clause "Simplified" License
7 stars 2 forks source link

Admin interface TemplateSyntaxError when editing volunteer ProjectMember #60

Closed mdraelos closed 9 years ago

mdraelos commented 12 years ago

Bugfix

The admin interface crashes when a superuser (maybe a regular user with appropriate permissions) attempts to edit a volunteer project member. Such project members have empty member fields, which I suspect is the root cause of the problem.

Steps to Reproduce

  1. Log in as a superuser
  2. Attempt to edit a volunteer project member (they have name "(None)") like /admin/cms/projectmember/190/
  3. TemplateSyntaxError thrown

Relevant Stacktrace

File ".../project/../apps/cms/models.py" in __unicode__
  162.             return self.get_full_name()
File ".../project/../apps/cms/models.py" in get_full_name
  154.             return self.member.user.get_full_name()

Exception Type: TemplateSyntaxError at /admin/cms/projectmember/190/
Exception Value: Caught AttributeError while rendering: 'NoneType' object has no attribute 'user'
jfposton commented 9 years ago

Couldn't Reproduce on February 3rd, 2015. Assuming that since this bug predates me joining the project it has already been fixed.