'TWL Team' should only leave a single comment in notify_applicants_tou_changes.py
@@ -26,8 +26,13 @@ class Command(BaseCommand):
.order_by("status", "partner", "date_created")
)
- # Loop through the apps and add a comment.
+ # Loop through the apps and add a comment if twl_team hasn't commented already.
for app in pending_apps:
+ if Comment.objects.filter(
+ object_pk=str(app.pk),
+ site_id=settings.SITE_ID,
+ user=twl_team,
+ ).count() == 0:
comment = Comment(
content_object=app,
site_id=settings.SITE_ID,
