Ver Fonte

optout user that doesn't want automatic SMS

tripeur há 2 anos atrás
pai
commit
9c57de7392
1 ficheiros alterados com 2 adições e 0 exclusões
  1. 2 0
      app/api/endpoints/project.py

+ 2 - 0
app/api/endpoints/project.py

@@ -148,6 +148,8 @@ async def create_sms_batch(
         )
         sending_time = slot.starting_time - timedelta(minutes=sms_batch.delta_t)
         for volunteer in slot.volunteers:
+            if not volunteer.automatic_sms:
+                continue
             # Create a new SMS customized for each user attache to the slot
             personalized_content = slot_content.replace(
                 "{prenom}", volunteer.name