Exemple #1
0
def registration_notice_fragment(request):
    rc = request.contest.controller.registration_controller()
    if (isinstance(rc, OIRegistrationController)
            and request.user.is_authenticated and not is_contest_admin(request)
            and not is_participant(request)):
        return render_to_string('oi/registration_notice.html', request=request)
    else:
        return None
Exemple #2
0
 def can_submit(self, request, problem_instance, check_round_times=True):
     if request.user.is_anonymous():
         return False
     if request.user.has_perm("contests.contest_admin", self.contest):
         return True
     if not is_participant(request):
         return False
     return super(OIContestController, self).can_submit(request, problem_instance, check_round_times)
Exemple #3
0
 def can_submit(self, request, problem_instance, check_round_times=True):
     if request.user.is_anonymous():
         return False
     if request.user.has_perm('contests.contest_admin', self.contest):
         return True
     if not is_participant(request):
         return False
     return super(PAContestController, self) \
             .can_submit(request, problem_instance, check_round_times)
Exemple #4
0
def registration_notice_fragment(request):
    rc = request.contest.controller.registration_controller()
    if isinstance(rc, PARegistrationController) \
            and request.user.is_authenticated \
            and not is_contest_admin(request) \
            and not is_participant(request) \
            and rc.can_register(request):
        return render_to_string('pa/registration-notice.html', request=request)
    else:
        return None
Exemple #5
0
def registration_notice_fragment(request):
    rc = request.contest.controller.registration_controller()
    if (
        isinstance(rc, OIRegistrationController)
        and request.user.is_authenticated()
        and not is_contest_admin(request)
        and not is_participant(request)
    ):
        return render_to_string("oi/registration_notice.html", context_instance=RequestContext(request))
    else:
        return None
Exemple #6
0
def registration_notice_fragment(request):
    rc = request.contest.controller.registration_controller()
    if isinstance(rc, PARegistrationController) \
            and request.user.is_authenticated \
            and not is_contest_admin(request) \
            and not is_participant(request) \
            and rc.can_register(request):
        return render_to_string('pa/registration-notice.html',
            request=request)
    else:
        return None