fi-ksi / web-backend

Backend for KSI web written in Python.
MIT License
8 stars 3 forks source link

Nelze odeslat mail #146

Closed esoadamo closed 2 years ago

esoadamo commented 2 years ago
Traceback (most recent call last):
  File "web-backend/endpoint/admin/email.py", line 129, in on_post
    for user_id, user in tos.items()
  File "web-backend/endpoint/admin/email.py", line 133, in <dictcomp>
    notifies[user_id].notify_events))
KeyError: 1161

https://github.com/fi-ksi/web-backend/blob/b3d95922ab7df6102064b492bc46786207a653f4/endpoint/admin/email.py#L133

Vypadá to, že existující uživatel (možná který byl registrován před výběrem zasílání?) může shodit odesílání mailu, jelikož pro něj neexistují záznamy v tabulce.

esoadamo commented 2 years ago
SELECT u.id, n.user, u.registered FROM `users` as u LEFT JOIN users_notify as n ON u.id=n.user WHERE n.user IS NULL ORDER BY u.id DESC;

Vypadá to, že lidé bez notifikačního záznamu se registrovali naposledy 2018 a teď na jaře 2020