Browse Source

optout user that doesn't want automatic SMS

tripeur 2 năm trước cách đây
mục cha
commit
9c57de7392
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  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