Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c2d5cc1f
authored
Apr 20, 2015
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
request: add success messages
Closes #403
parent
3e8389e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
circle/request/views.py
+12
-4
No files found.
circle/request/views.py
View file @
c2d5cc1f
...
@@ -19,9 +19,11 @@ from __future__ import unicode_literals, absolute_import
...
@@ -19,9 +19,11 @@ from __future__ import unicode_literals, absolute_import
from
django.views.generic
import
(
from
django.views.generic
import
(
UpdateView
,
TemplateView
,
DetailView
,
CreateView
,
FormView
,
DeleteView
,
UpdateView
,
TemplateView
,
DetailView
,
CreateView
,
FormView
,
DeleteView
,
)
)
from
django.contrib.messages.views
import
SuccessMessageMixin
from
django.shortcuts
import
redirect
,
get_object_or_404
from
django.shortcuts
import
redirect
,
get_object_or_404
from
django.core.exceptions
import
PermissionDenied
,
SuspiciousOperation
from
django.core.exceptions
import
PermissionDenied
,
SuspiciousOperation
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.utils.translation
import
ugettext
as
_
from
braces.views
import
SuperuserRequiredMixin
,
LoginRequiredMixin
from
braces.views
import
SuperuserRequiredMixin
,
LoginRequiredMixin
from
django_tables2
import
SingleTableView
from
django_tables2
import
SingleTableView
...
@@ -97,17 +99,19 @@ class RequestDetail(LoginRequiredMixin, DetailView):
...
@@ -97,17 +99,19 @@ class RequestDetail(LoginRequiredMixin, DetailView):
class
TemplateAccessTypeDetail
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
class
TemplateAccessTypeDetail
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
UpdateView
):
SuccessMessageMixin
,
UpdateView
):
model
=
TemplateAccessType
model
=
TemplateAccessType
template_name
=
"request/template-type-form.html"
template_name
=
"request/template-type-form.html"
form_class
=
TemplateAccessTypeForm
form_class
=
TemplateAccessTypeForm
success_message
=
_
(
"Template access type successfully updated."
)
class
TemplateAccessTypeCreate
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
class
TemplateAccessTypeCreate
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
CreateView
):
SuccessMessageMixin
,
CreateView
):
model
=
TemplateAccessType
model
=
TemplateAccessType
template_name
=
"request/template-type-form.html"
template_name
=
"request/template-type-form.html"
form_class
=
TemplateAccessTypeForm
form_class
=
TemplateAccessTypeForm
success_message
=
_
(
"New template access type successfully created."
)
class
TemplateAccessTypeDelete
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
class
TemplateAccessTypeDelete
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
...
@@ -119,16 +123,20 @@ class TemplateAccessTypeDelete(LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -119,16 +123,20 @@ class TemplateAccessTypeDelete(LoginRequiredMixin, SuperuserRequiredMixin,
return
reverse
(
"request.views.type-list"
)
return
reverse
(
"request.views.type-list"
)
class
LeaseTypeDetail
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
UpdateView
):
class
LeaseTypeDetail
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
SuccessMessageMixin
,
UpdateView
):
model
=
LeaseType
model
=
LeaseType
template_name
=
"request/lease-type-form.html"
template_name
=
"request/lease-type-form.html"
form_class
=
LeaseTypeForm
form_class
=
LeaseTypeForm
success_message
=
_
(
"Lease type successfully updated."
)
class
LeaseTypeCreate
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
CreateView
):
class
LeaseTypeCreate
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
SuccessMessageMixin
,
CreateView
):
model
=
LeaseType
model
=
LeaseType
template_name
=
"request/lease-type-form.html"
template_name
=
"request/lease-type-form.html"
form_class
=
LeaseTypeForm
form_class
=
LeaseTypeForm
success_message
=
_
(
"New lease type successfully created."
)
class
LeaseTypeDelete
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
DeleteView
):
class
LeaseTypeDelete
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
DeleteView
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment