def dispatch(self, request, *args, **kwargs):
self.returnJson = (request.POST.get('<STR_LIT>') in ['<STR_LIT:true>', True])<EOL>regonline = getConstant('<STR_LIT>')<EOL>if not regonline:<EOL><INDENT>returnUrl = reverse('<STR_LIT>')<EOL>if self.returnJson:<EOL><INDENT>return JsonResponse({'<STR_LIT:status>': '<STR_LIT:success>', '<STR_LIT>': returnUrl})<EOL><DEDENT>return HttpResponseRedirect(returnUrl)<EOL><DEDENT>return super().dispatch(request, *args, **kwargs)<EOL>
Check that registration is online before proceeding.  If this is a POST
request, determine whether the response should be provided in JSON form.