Пример #1
0
 def get_context_data(self, **kwargs):
     context = super(JobListView, self).get_context_data(**kwargs)
     if not user_has_valid_proxy(self.request.user):
         context['proxy_invalid'] = True
     if not hasattr(self.request.user, 'userproxy'):
         context['first_run'] = True
     return context
Пример #2
0
 def get_context_data(self, **kwargs):
     context = super(JobListView, self).get_context_data(**kwargs)
     if not user_has_valid_proxy(self.request.user):
         context['proxy_invalid'] = True
     if not hasattr(self.request.user, 'userproxy'):
         context['first_run'] = True
     return context
Пример #3
0
def new(request):
    if request.method == "GET":
        ctx = {}
        if not user_has_valid_proxy(request.user):
            ctx['proxy_invalid'] = True
        return render(request, 'rimrock_communication/new.html', ctx)
    elif request.method == "POST":
        if new_job(request):
            return redirect('all_jobs')
        else:
            return redirect('new')
Пример #4
0
def new(request):
    if request.method == "GET":
        ctx = {}
        if not user_has_valid_proxy(request.user):
            ctx['proxy_invalid'] = True
        return render(request, 'rimrock_communication/new.html', ctx)
    elif request.method == "POST":
        if new_job(request):
            return redirect('all_jobs')
        else:
            return redirect('new')