edited style to match other functions
This commit is contained in:
14
rtv/page.py
14
rtv/page.py
@@ -257,10 +257,16 @@ class BasePage(object):
|
||||
Delete a submission or comment.
|
||||
"""
|
||||
data = self.content.get(self.nav.absolute_index)
|
||||
if data['author'] == self.reddit.user.name:
|
||||
if data['author'] != self.reddit.user.name:
|
||||
show_notification(self.stdscr, ['You can\'t delete this'])
|
||||
return
|
||||
|
||||
prompt = 'Are you sure you want to delete this? (y/n):'
|
||||
char = self.prompt_input(prompt)
|
||||
if char == 'y':
|
||||
if char != 'y':
|
||||
show_notification(self.stdscr, ['Delete cancelled'])
|
||||
return
|
||||
|
||||
try:
|
||||
data['object'].delete()
|
||||
show_notification(self.stdscr, ['Deleted'])
|
||||
@@ -269,10 +275,6 @@ class BasePage(object):
|
||||
else:
|
||||
time.sleep(0.5)
|
||||
self.refresh_content()
|
||||
else:
|
||||
show_notification(self.stdscr, ['Delete cancelled'])
|
||||
else:
|
||||
show_notification(self.stdscr, ['You can\'t delete this'])
|
||||
|
||||
def logout(self):
|
||||
"Prompt to log out of the user's account."
|
||||
|
||||
Reference in New Issue
Block a user