app/soc/views/models/student_proposal.py
changeset 1840 bf2c705ead19
parent 1839 92b28d1bf2f5
child 1853 6cd70644892d
equal deleted inserted replaced
1839:92b28d1bf2f5 1840:bf2c705ead19
   388       params: dict with params for the view using this context
   388       params: dict with params for the view using this context
   389     """
   389     """
   390 
   390 
   391     from soc.logic.models.review import logic as review_logic
   391     from soc.logic.models.review import logic as review_logic
   392 
   392 
   393     context['student_name'] = entity.scope.name()
   393     student_entity = entity.scope
       
   394 
       
   395     context['student_name'] = student_entity.name()
       
   396 
       
   397     user_entity = user_logic.logic.getForCurrentAccount()
       
   398 
       
   399     # check if the current user is the student
       
   400     if user_entity.key() == student_entity.user.key():
       
   401       # show the proposal edit link
       
   402       context['edit_link'] = redirects.getEditRedirect(entity, params)
   394 
   403 
   395     context['public_reviews'] = review_logic.getReviewsForEntity(entity,
   404     context['public_reviews'] = review_logic.getReviewsForEntity(entity,
   396         is_public=True, order=['created'])
   405         is_public=True, order=['created'])
   397 
   406 
   398   @decorators.merge_params
   407   @decorators.merge_params