Exemplo n.º 1
0
def home(request):
    # Adapt layout depending on the type of user (student, professor)
    return layout.render(
        request, "dashboard.html", {
            'online_application_opened':
            permission.is_online_application_opened(request.user)
        })
Exemplo n.º 2
0
    def test_application_session_period_opened(self):
        test_academic_year.create_academic_year_with_year(CURRENT_YEAR)
        next_academic_year = test_academic_year.create_academic_year_with_year(
            NEXT_YEAR)

        test_academic_calendar.create_academic_calendar(
            next_academic_year, permission.TEACHING_CHARGE_APPLICATION, now,
            now)

        self.assertEqual(permission.is_online_application_opened(self.a_user),
                         True)
Exemplo n.º 3
0
 def test_application_session_period_closed(self):
     current_academic_year = test_academic_year.create_academic_year_with_year(
         CURRENT_YEAR)
     test_academic_year.create_academic_year_with_year(NEXT_YEAR)
     two_weeks_ago = datetime.datetime.today() - datetime.timedelta(15)
     test_academic_calendar.create_academic_calendar(
         current_academic_year,
         academic_calendar_type.TEACHING_CHARGE_APPLICATION, two_weeks_ago,
         two_weeks_ago + datetime.timedelta(1))
     self.assertEqual(permission.is_online_application_opened(self.a_user),
                      False)
Exemplo n.º 4
0
 def test_application_session_period_closed(self):
     test_academic_year.create_academic_year_with_year(CURRENT_YEAR)
     next_academic_year = test_academic_year.create_academic_year_with_year(
         NEXT_YEAR)
     two_weeks_ago = datetime.datetime.now() - datetime.timedelta(15)
     test_academic_calendar.create_academic_calendar(
         next_academic_year, permission.TEACHING_CHARGE_APPLICATION,
         datetime.datetime(two_weeks_ago.year, two_weeks_ago.month,
                           two_weeks_ago.day),
         datetime.datetime(two_weeks_ago.year, two_weeks_ago.month,
                           two_weeks_ago.day + 1))
     self.assertEqual(permission.is_online_application_opened(self.a_user),
                      False)
Exemplo n.º 5
0
def home(request):
    return layout.render(
        request, "dashboard.html", {
            'online_application_opened':
            permission.is_online_application_opened(request.user),
            'summary_course_submission_opened':
            permission.is_summary_course_submission_opened(request.user),
            'is_summary_responsible':
            permission.is_summary_responsible(request.user),
            'manage_courses_url':
            settings.OSIS_MANAGE_COURSES_URL,
            'osis_vpn_help_url':
            settings.OSIS_VPN_HELP_URL
        })
Exemplo n.º 6
0
def faculty_administration(request):
    return layout.render(
        request, "faculty_administrator_dashboard.html", {
            'online_application_opened':
            permission.is_online_application_opened(request.user)
        })
Exemplo n.º 7
0
def faculty_administration(request):
    if not _can_access_administration(request):
        raise PermissionDenied
    return layout.render(request, "faculty_administrator_dashboard.html",
                         {'online_application_opened': permission.is_online_application_opened(request.user)})
Exemplo n.º 8
0
 def test_permission_is_undefined_no_academic_calendar(self):
     test_academic_year.create_academic_year_with_year(CURRENT_YEAR)
     test_academic_year.create_academic_year_with_year(NEXT_YEAR)
     self.assertEqual(permission.is_online_application_opened(self.a_user),
                      False)
Exemplo n.º 9
0
 def test_permission_is_undefined_no_academic_year(self):
     self.assertEqual(permission.is_online_application_opened(self.a_user),
                      False)