From 033cbd2a994aa3f8bae2a8c0cd0680a34914c5c4 Mon Sep 17 00:00:00 2001 From: db0 Date: Sun, 2 Jul 2023 14:27:09 +0200 Subject: [PATCH] fix: remove automatic endorsement --- fediseer/apis/v1/guarantees.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fediseer/apis/v1/guarantees.py b/fediseer/apis/v1/guarantees.py index 781e25b..10431d7 100644 --- a/fediseer/apis/v1/guarantees.py +++ b/fediseer/apis/v1/guarantees.py @@ -97,15 +97,15 @@ class Guarantees(Resource): guarantor_id=instance.id, ) db.session.add(new_guarantee) - # Guaranteed instances get their automatic first endorsement - new_endorsement = Endorsement( - approving_id=instance.id, - endorsed_id=target_instance.id, - ) - db.session.add(new_endorsement) + # # Guaranteed instances get their automatic first endorsement + # new_endorsement = Endorsement( + # approving_id=instance.id, + # endorsed_id=target_instance.id, + # ) + # db.session.add(new_endorsement) db.session.commit() activitypub_pm.pm_admins( - message=f"Congratulations! Your instance has just been guaranteed by {instance.domain}. This also comes with your first endorsement.\n\nThis is an automated PM by the [Fediseer](https://fediseer.com) service.", + message=f"Congratulations! Your instance has just been guaranteed by {instance.domain}. \n\nThis is an automated PM by the [Fediseer](https://fediseer.com) service.", domain=target_instance.domain, software=target_instance.software, instance=target_instance, @@ -153,7 +153,7 @@ class Guarantees(Resource): return {"message":'OK'}, 200 if database.has_recent_rejection(target_instance.id,instance.id): raise e.Forbidden("You cannot remove your guarantee from the same instance within 24 hours") - # Removing a guarantee removes the endorsement + # Removing a guarantee removes any endorsement from the same instance endorsement = database.get_endorsement(target_instance.id,instance.id) if endorsement: db.session.delete(endorsement)