# HG changeset patch # User Sverre Rabbelier # Date 1237046953 0 # Node ID ea2e23e5b7a1c38eb162cb6dc582a431b72915df # Parent 8ff0858f5b03161dbc80196389287bde6aaed0c8 Show 'list my org apps' only if you have org apps Patch by: Sverre Rabbelier diff -r 8ff0858f5b03 -r ea2e23e5b7a1 app/soc/views/models/program.py --- a/app/soc/views/models/program.py Sat Mar 14 16:08:38 2009 +0000 +++ b/app/soc/views/models/program.py Sat Mar 14 16:09:13 2009 +0000 @@ -38,6 +38,7 @@ from soc.logic.models import mentor as mentor_logic from soc.logic.models import organization as org_logic from soc.logic.models import org_admin as org_admin_logic +from soc.logic.models import org_app as org_app_logic from soc.logic.models import student_proposal as student_proposal_logic from soc.logic.models import program as program_logic from soc.logic.models import student as student_logic @@ -529,11 +530,17 @@ "Apply to become an Organization", 'any_access')] if user and timeline_helper.isAfterEvent(timeline_entity, 'org_signup_start'): - # add the 'List my Organization Applications' link - items += [ - (redirects.getListSelfRedirect(program_entity, - {'url_name' : 'org_app'}), - "List My Organization Applications", 'any_access')] + filter = { + 'applicant': user, + 'scope': program_entity, + } + + if org_app_logic.logic.getForFields(filter, unique=True): + # add the 'List my Organization Applications' link + items += [ + (redirects.getListSelfRedirect(program_entity, + {'url_name' : 'org_app'}), + "List My Organization Applications", 'any_access')] # get the student entity for this user and program filter = {'user': user,