From 4804c4c4b2456389d0399fd6852aeaf093309af8 Mon Sep 17 00:00:00 2001 From: freamon Date: Thu, 21 Mar 2024 23:26:03 +0000 Subject: [PATCH] Avoid returning 'null' for manuallyApprovesFollowers --- app/activitypub/routes.py | 2 +- app/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/activitypub/routes.py b/app/activitypub/routes.py index 922c2385..6bd0a8cf 100644 --- a/app/activitypub/routes.py +++ b/app/activitypub/routes.py @@ -203,7 +203,7 @@ def user_profile(actor): "outbox": f"https://{server}/u/{actor}/outbox", "discoverable": user.searchable, "indexable": user.indexable, - "manuallyApprovesFollowers": user.ap_manually_approves_followers, + "manuallyApprovesFollowers": False if not user.ap_manually_approves_followers else user.ap_manually_approves_followers, "publicKey": { "id": f"https://{server}/u/{actor}#main-key", "owner": f"https://{server}/u/{actor}", diff --git a/app/models.py b/app/models.py index 9b2d7a10..93e0c1fe 100644 --- a/app/models.py +++ b/app/models.py @@ -488,7 +488,7 @@ class User(UserMixin, db.Model): ap_fetched_at = db.Column(db.DateTime) ap_followers_url = db.Column(db.String(255)) ap_preferred_username = db.Column(db.String(255)) - ap_manually_approves_followers = db.Column(db.Boolean) + ap_manually_approves_followers = db.Column(db.Boolean, default=False) ap_deleted_at = db.Column(db.DateTime) ap_inbox_url = db.Column(db.String(255)) ap_domain = db.Column(db.String(255))