Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bookshare
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
30
Issues
30
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
SRCT
bookshare
Commits
1a5b793d
Commit
1a5b793d
authored
Feb 24, 2020
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nice little confirmation message when you delete a lookout, perhaps a preview of more to come
parent
bb17d034
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
bookshare/lookouts/views.py
bookshare/lookouts/views.py
+4
-2
No files found.
bookshare/lookouts/views.py
View file @
1a5b793d
...
...
@@ -6,7 +6,7 @@ from django.core.urlresolvers import reverse
from
django.utils.safestring
import
mark_safe
from
django.views.generic
import
CreateView
,
DetailView
,
DeleteView
# third-party imports
from
braces.views
import
LoginRequiredMixin
from
braces.views
import
LoginRequiredMixin
,
FormValidMessageMixin
from
ratelimit.decorators
import
ratelimit
# imports from your apps
from
.forms
import
LookoutForm
...
...
@@ -66,13 +66,15 @@ class DetailLookout(LoginRequiredMixin, DetailView):
# updating is not neccessary since it's just literally an isbn and a course
class
DeleteLookout
(
LoginRequiredMixin
,
DeleteView
):
class
DeleteLookout
(
LoginRequiredMixin
,
FormValidMessageMixin
,
DeleteView
):
model
=
Lookout
context_object_name
=
'lookout'
template_name
=
'delete_lookout.html'
success_url
=
'/'
login_url
=
'login'
form_valid_message
=
"Your lookout was successfully deleted."
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
me
=
self
.
request
.
user
.
student
lookout_student
=
self
.
get_object
().
owner
...
...
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