From e3c4377db652aafe369915f048d08792d2a75df9 Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Wed, 14 Dec 2022 09:03:57 -0500 Subject: [PATCH] fix NameError in Connection.delete_instance --- relay/database.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/relay/database.py b/relay/database.py index 70b4e25..eee269e 100644 --- a/relay/database.py +++ b/relay/database.py @@ -125,7 +125,7 @@ class Connection(tinysql.ConnectionMixin): row = self.get_instance(domain) if not row: - raise KeyError(name) + raise KeyError(domain) self.delete('instances', id=row.id) @@ -192,6 +192,7 @@ class Connection(tinysql.ConnectionMixin): def get_instances(self): query = 'SELECT * FROM instances WHERE joined IS NOT NULL' + query += ' ORDER BY domain ASC' return self.execute(query, table='instances').all() @@ -204,7 +205,7 @@ class Connection(tinysql.ConnectionMixin): def get_requests(self): - query = 'SELECT * FROM instances WHERE joined IS NULL' + query = 'SELECT * FROM instances WHERE joined IS NULL ORDER BY domain ASC' return self.execute(query, table='instances').all()