36 from soc.logic.helper import timeline as timeline_helper |
36 from soc.logic.helper import timeline as timeline_helper |
37 from soc.logic.models import host as host_logic |
37 from soc.logic.models import host as host_logic |
38 from soc.logic.models import mentor as mentor_logic |
38 from soc.logic.models import mentor as mentor_logic |
39 from soc.logic.models import organization as org_logic |
39 from soc.logic.models import organization as org_logic |
40 from soc.logic.models import org_admin as org_admin_logic |
40 from soc.logic.models import org_admin as org_admin_logic |
|
41 from soc.logic.models import org_app as org_app_logic |
41 from soc.logic.models import student_proposal as student_proposal_logic |
42 from soc.logic.models import student_proposal as student_proposal_logic |
42 from soc.logic.models import program as program_logic |
43 from soc.logic.models import program as program_logic |
43 from soc.logic.models import student as student_logic |
44 from soc.logic.models import student as student_logic |
44 from soc.logic.models.document import logic as document_logic |
45 from soc.logic.models.document import logic as document_logic |
45 from soc.views import helper |
46 from soc.views import helper |
527 items += [ |
528 items += [ |
528 (redirects.getApplyRedirect(program_entity, {'url_name': 'org_app'}), |
529 (redirects.getApplyRedirect(program_entity, {'url_name': 'org_app'}), |
529 "Apply to become an Organization", 'any_access')] |
530 "Apply to become an Organization", 'any_access')] |
530 |
531 |
531 if user and timeline_helper.isAfterEvent(timeline_entity, 'org_signup_start'): |
532 if user and timeline_helper.isAfterEvent(timeline_entity, 'org_signup_start'): |
532 # add the 'List my Organization Applications' link |
533 filter = { |
533 items += [ |
534 'applicant': user, |
534 (redirects.getListSelfRedirect(program_entity, |
535 'scope': program_entity, |
535 {'url_name' : 'org_app'}), |
536 } |
536 "List My Organization Applications", 'any_access')] |
537 |
|
538 if org_app_logic.logic.getForFields(filter, unique=True): |
|
539 # add the 'List my Organization Applications' link |
|
540 items += [ |
|
541 (redirects.getListSelfRedirect(program_entity, |
|
542 {'url_name' : 'org_app'}), |
|
543 "List My Organization Applications", 'any_access')] |
537 |
544 |
538 # get the student entity for this user and program |
545 # get the student entity for this user and program |
539 filter = {'user': user, |
546 filter = {'user': user, |
540 'scope': program_entity, |
547 'scope': program_entity, |
541 'status': 'active'} |
548 'status': 'active'} |