Internal Server Error: /request/template/
Internal Server Error: /request/template/
Traceback (most recent call last):
File "/home/cloud/.virtualenvs/circle/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/cloud/.virtualenvs/circle/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in view
return self.dispatch(request, *args, **kwargs)
File "/home/cloud/.virtualenvs/circle/local/lib/python2.7/site-packages/django/views/generic/base.py", line 87, in dispatch
return handler(request, *args, **kwargs)
File "/home/cloud/.virtualenvs/circle/local/lib/python2.7/site-packages/django/views/generic/edit.py", line 173, in post
return self.form_valid(form)
File "./request/views.py", line 173, in form_valid
user=user,
File "/home/cloud/.virtualenvs/circle/local/lib/python2.7/site-packages/django/db/models/base.py", line 440, in __init__
setattr(self, field.name, rel_obj)
File "/home/cloud/.virtualenvs/circle/local/lib/python2.7/site-packages/django/db/models/fields/related.py", line 597, in __set__
self.field.rel.to._meta.object_name,
ValueError: Cannot assign "<SimpleLazyObject: <django.contrib.auth.models.AnonymousUser object at 0x7f48b90999d0>>": "TemplateAccessAction.user" must be a "User" instance.
-
Owner
diff --git a/circle/request/views.py b/circle/request/views.py index a670b1e..3134ee7 100644 --- a/circle/request/views.py +++ b/circle/request/views.py @@ -154,7 +154,7 @@ class RequestTypeList(LoginRequiredMixin, SuperuserRequiredMixin, return context -class TemplateRequestView(FormView): +class TemplateRequestView(LoginRequiredMixin, FormView): form_class = TemplateRequestForm template_name = "request/request-template.html" @@ -185,7 +185,7 @@ class TemplateRequestView(FormView): return redirect("/") -class VmRequestMixin(object): +class VmRequestMixin(LoginRequiredMixin, object): def get_vm(self): return get_object_or_404(Instance, pk=self.kwargs['vm_pk'])
-
-
Status changed to closed
Toggle commit list
Please
register
or
sign in
to comment