From 85c4df7d8c9f6ddfbd0e6db04ab5e45121f01fc9 Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Fri, 18 Nov 2022 16:57:34 -0500 Subject: [PATCH] remove unecessary method --- relay/database.py | 5 ----- relay/manage.py | 10 ++++++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/relay/database.py b/relay/database.py index 3a9f5c9..ca26f50 100644 --- a/relay/database.py +++ b/relay/database.py @@ -175,11 +175,6 @@ class RelayDatabase(dict): return False - def set_followid(self, domain, followid): - data = self.get_inbox(domain, fail=True) - data['followid'] = followid - - def get_request(self, domain, fail=True): if domain.startswith('http'): domain = urlparse(domain).hostname diff --git a/relay/manage.py b/relay/manage.py index 3b55717..ecd466f 100644 --- a/relay/manage.py +++ b/relay/manage.py @@ -128,11 +128,13 @@ def cli_inbox_add(inbox): if app.config.is_banned(inbox): return click.echo(f'Error: Refusing to add banned inbox: {inbox}') - if app.database.add_inbox(inbox): - app.database.save() - return click.echo(f'Added inbox to the database: {inbox}') + if app.database.get_inbox(inbox): + return click.echo(f'Error: Inbox already in database: {inbox}') - click.echo(f'Error: Inbox already in database: {inbox}') + app.database.add_inbox(inbox) + app.database.save() + + click.echo(f'Added inbox to the database: {inbox}') @cli_inbox.command('remove')