aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'webmentions_ssg/views.py')
-rw-r--r--webmentions_ssg/views.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/webmentions_ssg/views.py b/webmentions_ssg/views.py
index b19d832..b2f7e7e 100644
--- a/webmentions_ssg/views.py
+++ b/webmentions_ssg/views.py
@@ -164,7 +164,7 @@ def reverify_received_webmention(identifier: uuid.UUID) -> ResponseReturnValue:
db.session.commit()
- verify_webmention(identifier)
+ verify_webmention(identifier, send_notification=False)
flash(f"Webmention {webmention.uuid} queued for reverification.", "success")
@@ -315,6 +315,9 @@ def endpoint() -> ResponseReturnValue:
)
).scalar_one_or_none()
+ # Only notify about new webmentions, not resubmissions of existing ones.
+ send_notification = webmention is None
+
if webmention is None:
identifier = uuid.uuid7()
@@ -326,6 +329,7 @@ def endpoint() -> ResponseReturnValue:
db.session.commit()
except sa_exc.IntegrityError:
db.session.rollback()
+ send_notification = False
# Another request may have inserted the same source/target pair
# after our SELECT but before our COMMIT.
@@ -351,7 +355,7 @@ def endpoint() -> ResponseReturnValue:
db.session.commit()
- verify_webmention(webmention.uuid)
+ verify_webmention(webmention.uuid, send_notification=send_notification)
status_url = url_for("root.status", identifier=str(identifier), _external=True)