Преглед на файлове

optout user that doesn't want automatic SMS

tripeur преди 2 години
родител
ревизия
9c57de7392
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  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