Fix exception reporting

pull/1/head
Luca 3 years ago
parent 73d214615e
commit df9493f6cd

@ -49,8 +49,10 @@ class CancelMin(types.DurationPreference):
name = "min_cancel_time"
default = datetime.timedelta(hours=6)
@global_preferences_registry.register
class SMSRate(types.IntegerPreference):
section = helper
name = "sms_rate"
default = 2
help_text = "Number of SMS sent per minute"

@ -29,7 +29,9 @@ def send_messages():
print("sms disabled, not sending")
return
msgs = Message.objects.select_for_update().filter(sent_at__isnull=True)[:global_preferences['helper__sms_rate']*2]
msgs = Message.objects.select_for_update().filter(sent_at__isnull=True)[
: global_preferences["helper__sms_rate"] * 2
]
with transaction.atomic():
for msg in msgs:
if msg.sent_at:
@ -38,7 +40,7 @@ def send_messages():
send(msg)
msg.sent_at = timezone.now()
msg.save()
except e:
except Exception as e:
sentry_sdk.capture_exception(e)
@ -80,5 +82,5 @@ def send_reminders():
continue
try:
reg.send_reminder()
except:
pass
except Exception as e:
sentry_sdk.capture_exception(e)

@ -1,3 +1 @@
<div class="content">
<h5 class="mb-2">Hier erscheint bald die Karte mit allen Schichtstandorten</h5>
</div>
<h5 class="subtitle">Hier erscheint bald die Karte mit allen Schichtstandorten</h5>

Loading…
Cancel
Save