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
R
roomlist
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SRCT
roomlist
Commits
be90d9d8
Commit
be90d9d8
authored
Oct 23, 2016
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a byproduct of writing tests-- this set of logic requires different indentation
parent
2d7bf092
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
roomlist/accounts/views.py
roomlist/accounts/views.py
+11
-5
No files found.
roomlist/accounts/views.py
View file @
be90d9d8
...
...
@@ -544,15 +544,21 @@ class DeleteConfirmation(LoginRequiredMixin, DeleteView):
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
requester
=
self
.
request
.
user
.
student
try
:
confirmer
=
self
.
get_object
().
confirmer
except
ObjectDoesNotExist
:
raise
Http404
current_url
=
self
.
request
.
get_full_path
()
confirmer_uname
=
current_url
.
split
(
'/'
)[
3
]
confirmer
=
Student
.
objects
.
get
(
user__username
=
confirmer_uname
)
# only the person who created the confirmation may delete it
if
not
(
requester
==
confirmer
):
return
HttpResponseForbidden
()
# however, if the confirmation just flat out doesn't exist...
else
:
return
super
(
DeleteConfirmation
,
self
).
get
(
request
,
*
args
,
**
kwargs
)
try
:
confirmer
=
self
.
get_object
().
confirmer
except
ObjectDoesNotExist
:
raise
Http404
else
:
return
super
(
DeleteConfirmation
,
self
).
get
(
request
,
*
args
,
**
kwargs
)
def
get_object
(
self
):
current_url
=
self
.
request
.
get_full_path
()
...
...
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