From 0173cc90a4fc4e10546d91857df85685f793ffc9 Mon Sep 17 00:00:00 2001 From: Jonathan Zernik Date: Fri, 22 Oct 2021 19:27:12 -0500 Subject: [PATCH] Remove db property for profile has no private key (#1680) --- squeaknode/db/squeak_db.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/squeaknode/db/squeak_db.py b/squeaknode/db/squeak_db.py index f2ba61d3..9437d80b 100644 --- a/squeaknode/db/squeak_db.py +++ b/squeaknode/db/squeak_db.py @@ -146,10 +146,6 @@ class SqueakDb: def profile_has_private_key(self): return self.profiles.c.private_key != None # noqa: E711 - @property - def profile_has_no_private_key(self): - return self.profiles.c.private_key == None # noqa: E711 - @property def profile_is_following(self): return self.profiles.c.following == True # noqa: E711 @@ -701,7 +697,7 @@ class SqueakDb: ) ) .where(self.squeak_is_older_than_retention(interval_s)) - .where(self.profile_has_no_private_key) + .where(not_(self.profile_has_private_key)) .where(self.squeak_is_not_liked) ) with self.get_connection() as connection: @@ -744,7 +740,7 @@ class SqueakDb: def get_contact_profiles(self) -> List[SqueakProfile]: """ Get all contact profiles. """ - s = select([self.profiles]).where(self.profile_has_no_private_key) + s = select([self.profiles]).where(not_(self.profile_has_private_key)) with self.get_connection() as connection: result = connection.execute(s) rows = result.fetchall()