deltachat / mailadm

mail account administration tool for temporary and other account creation/modification
https://mailadm.readthedocs.io/
Mozilla Public License 2.0
14 stars 1 forks source link

fix: don't crash if user doesn't exist in mailcow #133

Closed missytake closed 4 months ago

missytake commented 4 months ago

Fixes this annoying crash:

2024-04-11T12:26:09.426000639Z Traceback (most recent call last):                                                                                                                                                                            
2024-04-11T12:26:09.426011588Z   File "/usr/lib/python3.10/site-packages/mailadm/bot.py", line 270, in main                                                                                                                                  
2024-04-11T12:26:09.426021251Z     for logmsg in prune(mailadm_db).get("message"):                                                                                                                                                           
2024-04-11T12:26:09.426030978Z   File "/usr/lib/python3.10/site-packages/mailadm/commands.py", line 70, in prune                                                                                                                             
2024-04-11T12:26:09.426042245Z     expired_users = conn.get_expired_users(sysdate)                                                                                                                                                           
2024-04-11T12:26:09.426048044Z   File "/usr/lib/python3.10/site-packages/mailadm/conn.py", line 278, in get_expired_users                                                                                                                    
2024-04-11T12:26:09.426062633Z     last_login = self.get_mailcow_connection().get_user(user.addr).last_login                                                                                                                                 
2024-04-11T12:26:09.426068696Z AttributeError: 'NoneType' object has no attribute 'last_login'                                                                                                                                               
hpk42 commented 4 months ago

CI tests fail

missytake commented 4 months ago

CI tests fail

yes, we deprecated ci.testrun.org and don't have a mailcow for that right now, unless we want to use testrun.org for that (rather not). dc.develcow.de would also make sense. hm.