Создаю файл на всякий случай

This commit is contained in:
zakhy 2025-03-05 11:18:38 +07:00
parent c999510321
commit 1bfbea8f0b

View File

@ -435,9 +435,11 @@ def alarm_play(request):
path_alarm = Settings.objects.filter(name="alarm").first()
path_outgoing = Settings.objects.filter(name="outgoing").first()
file_src = settings.MEDIA_ROOT + str(alarm.audio_file)
os.makedirs(path_alarm.value, exist_ok=True)
shutil.copy(file_src, path_alarm.value + "/1.mp3")
notifier_list = Notifier.objects.order_by("pla_groups", "name").all()
os.makedirs(path_outgoing.value, exist_ok=True)
for notifier in notifier_list:
file = open(path_outgoing.value + "/" + notifier.sip_number, "a")
my_file = File(file)