396 student_entity = ghop_student_logic.logic.getForFields(filter, unique=True) |
396 student_entity = ghop_student_logic.logic.getForFields(filter, unique=True) |
397 |
397 |
398 if student_entity: |
398 if student_entity: |
399 items += self._getStudentEntries(ghop_program_entity, student_entity, |
399 items += self._getStudentEntries(ghop_program_entity, student_entity, |
400 params, id, user) |
400 params, id, user) |
|
401 else: |
|
402 # if a user has a task assigned, he or she still may list it |
|
403 filter = { |
|
404 'user': user, |
|
405 'program': ghop_program_entity, |
|
406 'status': ['ClaimRequested', 'Claimed', 'ActionNeeded', 'NeedsWork', |
|
407 'AwaitingRegistration', 'NeedsReview'] |
|
408 } |
|
409 tasks = ghop_task_logic.logic.getForFields(filter) |
|
410 |
|
411 if tasks: |
|
412 items += [(ghop_redirects.getListStudentTasksRedirect( |
|
413 ghop_program_entity, {'url_name':'ghop/student'}), |
|
414 "List my Tasks", 'any_access')] |
401 |
415 |
402 # get mentor and org_admin entity for this user and program |
416 # get mentor and org_admin entity for this user and program |
403 filter = {'user': user, |
417 filter = {'user': user, |
404 'program': ghop_program_entity, |
418 'program': ghop_program_entity, |
405 'status': 'active'} |
419 'status': 'active'} |