Page Redesign to Delete confirmation page
This commit is contained in:
committed by
Christopher Allan Webber
parent
a237735a70
commit
8daef28dc7
@@ -26,7 +26,5 @@ class MediaCommentForm(wtforms.Form):
|
||||
|
||||
|
||||
class ConfirmDeleteForm(wtforms.Form):
|
||||
confirm = wtforms.RadioField('Confirm',
|
||||
default='False',
|
||||
choices=[('False', 'No, I made a mistake!'),
|
||||
('True', 'Yes, delete it!')])
|
||||
confirm = wtforms.BooleanField('I am sure I want to delete this',
|
||||
[wtforms.validators.Required()])
|
||||
|
||||
@@ -154,7 +154,7 @@ def media_confirm_delete(request, media):
|
||||
form = user_forms.ConfirmDeleteForm(request.POST)
|
||||
|
||||
if request.method == 'POST' and form.validate():
|
||||
if request.POST.get('confirm') == 'True':
|
||||
if form.confirm.data is True:
|
||||
username = media.uploader()['username']
|
||||
|
||||
# Delete all files on the public storage
|
||||
|
||||
Reference in New Issue
Block a user