app/soc/views/models/student_project.py
changeset 2280 157f6b8de010
parent 2279 e31414fd3b2a
child 2281 a702d92a57a6
equal deleted inserted replaced
2279:e31414fd3b2a 2280:157f6b8de010
   198     filter = {'scope': organization,
   198     filter = {'scope': organization,
   199               'link_id': fields['mentor_id'],
   199               'link_id': fields['mentor_id'],
   200               'status': 'active'}
   200               'status': 'active'}
   201     fields['mentor'] = mentor_logic.logic.getForFields(filter, unique=True)
   201     fields['mentor'] = mentor_logic.logic.getForFields(filter, unique=True)
   202 
   202 
       
   203   def _public(self, request, entity, context):
       
   204     """Adds the names of all additional mentors to the context.
       
   205 
       
   206     For params see base.View._public()
       
   207     """
       
   208 
       
   209     additional_mentors = entity.additional_mentors
       
   210 
       
   211     if not additional_mentors:
       
   212       context['additional_mentors'] = []
       
   213     else:
       
   214       mentor_names = []
       
   215 
       
   216       for mentor_key in additional_mentors:
       
   217         additional_mentor = mentor_logic.logic.getFromKeyName(
       
   218             mentor_key.id_or_name())
       
   219         mentor_names.append(additional_mentor.name())
       
   220 
       
   221       context['additional_mentors'] = ', '.join(mentor_names)
       
   222 
   203   @decorators.merge_params
   223   @decorators.merge_params
   204   @decorators.check_access
   224   @decorators.check_access
   205   def manage(self, request, access_type,
   225   def manage(self, request, access_type,
   206              page_name=None, params=None, **kwargs):
   226              page_name=None, params=None, **kwargs):
   207     """View that allows Organization Admins to manage their Student Projects.
   227     """View that allows Organization Admins to manage their Student Projects.