diff options
author | luxagraf <sng@luxagraf.net> | 2019-05-02 09:36:31 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2019-05-02 09:36:31 -0500 |
commit | 9d73326aad4d9aee61a16f7274819fa93f32dc72 (patch) | |
tree | 9cf21f7a514478ef3e1593dd346dad144c37fdea /apps/utils/views.py | |
parent | 5b9343d77d8321e44d1ffc60769c651771dc38dd (diff) |
migrated to LXC container
Diffstat (limited to 'apps/utils/views.py')
-rw-r--r-- | apps/utils/views.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/utils/views.py b/apps/utils/views.py index c752706..677ac4b 100644 --- a/apps/utils/views.py +++ b/apps/utils/views.py @@ -4,6 +4,7 @@ from django.http import Http404, HttpResponse, JsonResponse from django.apps import apps from django.views.generic import ListView from django.views.generic.base import View, RedirectView +from django.views.generic.edit import FormView, ModelFormMixin from django.utils.decorators import method_decorator from django.contrib.auth.decorators import login_required #from photos.models import LuxImage, LuxVideo @@ -42,6 +43,14 @@ class LoggedInViewWithUser(View): return kwargs +@method_decorator(login_required, name='dispatch') +class LoggedInViewWithUser(FormView): + + def get_form_kwargs(self, **kwargs): + kwargs = super().get_form_kwargs(**kwargs) + kwargs.update({'user': self.request.user}) + return kwargs + class AjaxableResponseMixin: """ |