예제 #1
0
def financial_aid(request):
    open = applications_open()
    ctx = {
        "show_finaid_apply_button": open and not has_application(request.user),
        "show_finaid_edit_button": open and has_application(request.user),
        "show_finaid_status_button": has_application(request.user),
        "show_finaid_review_button": is_reviewer(request.user),
        "show_finaid_download_button": is_reviewer(request.user),
    }

    ctx["show_financial_aid_section"] = \
        ctx["show_finaid_apply_button"] or ctx["show_finaid_edit_button"] \
        or ctx["show_finaid_status_button"] or ctx["show_finaid_review_button"]

    return ctx
예제 #2
0
def financial_aid(request):
    open = applications_open()
    ctx = {
        "show_finaid_apply_button": open and not has_application(request.user),
        "show_finaid_edit_button": open and has_application(request.user),
        "show_finaid_status_button": has_application(request.user),
        "show_finaid_review_button": is_reviewer(request.user),
        "show_finaid_download_button": is_reviewer(request.user),
    }

    ctx["show_financial_aid_section"] = (
        ctx["show_finaid_apply_button"]
        or ctx["show_finaid_edit_button"]
        or ctx["show_finaid_status_button"]
        or ctx["show_finaid_review_button"]
    )

    return ctx
예제 #3
0
def financial_aid(request):
    open = applications_open()
    if has_application(request.user):
        application = request.user.financial_aid
    else:
        application = None

    ctx = {
        "show_finaid_apply_button":
        open and (not application or has_withdrawn_application(request.user)),
        "show_finaid_edit_button":
        application and application.show_edit_button,
        "show_finaid_status_button":
        application and application.show_status_button,
        "show_finaid_review_button":
        is_reviewer(request.user),
        "show_finaid_receipt_review_button":
        is_reviewer(request.user)
        and request.user.has_perm('finaid.can_review_receipts'),
        "show_finaid_download_button":
        is_reviewer(request.user),
        "show_finaid_receipt_form":
        offer_accepted(request.user),
        "show_finaid_withdraw_button":
        application and application.show_withdraw_button,
        "show_finaid_accept_button":
        application and application.show_accept_button,
        "show_finaid_decline_button":
        application and application.show_decline_button,
        "show_finaid_request_more_button":
        application and application.show_request_more_button,
        "show_finaid_provide_info_button":
        application and application.show_provide_info_button,
        "show_finaid_reimbursement_update":
        application and application.show_update_reimbursement_details_button,
    }

    ctx["show_financial_aid_section"] = \
        ctx["show_finaid_apply_button"] or ctx["show_finaid_edit_button"] \
        or ctx["show_finaid_status_button"] or ctx["show_finaid_review_button"]

    return ctx
예제 #4
0
파일: test_review.py 프로젝트: ptone/pycon
 def test_reviewer_is_reviewer(self):
     self.make_reviewer(self.user)
     self.assertTrue(is_reviewer(self.user))
예제 #5
0
파일: test_review.py 프로젝트: ptone/pycon
 def test_non_reviewer_is_reviewer(self):
     self.assertFalse(is_reviewer(self.user))
예제 #6
0
 def test_reviewer_is_reviewer(self):
     self.make_reviewer(self.user)
     self.assertTrue(is_reviewer(self.user))
예제 #7
0
 def test_non_reviewer_is_reviewer(self):
     self.assertFalse(is_reviewer(self.user))