sebo-b / warp

Workspace Autonomous Reservation Program - a system to help you efficiently manage hybrid (assigned, hot-desks, etc) office space.
MIT License
139 stars 60 forks source link

Recent peewe version makes it fail on group zone assignement #6

Closed n-rodrig closed 2 years ago

n-rodrig commented 2 years ago

Hi, sebo-b:

First of all, I would like to thank you for this project. Great job!

Second, I have found that last time I built the whole project, the resulting deployment failed when assigning groups to zones. After a little research, I found that something was wrong in :

_cab_warp-warp-demo-wsgi-1 | File "/usr/local/lib/python3.10/site-packages/warp/xhr/zones.py", line 209, in assign

cabwarp-warp-demo-wsgi-1 | raise ApplyError(f"Wrong number of affected rows {rowCount} != "+ str(len(jsonData['change'])), 223)

Something seems to have changed on last version of peewe. The easy solution is to force peewe version en requirements.txt as peewee==3.14.10, doing so everything works fine.

I hope this pice of advise is usefull for new users.

cheers!

mpolitze commented 2 years ago

I assume this might be related to this issue in pewee https://github.com/coleifer/peewee/issues/2026). Adding .as_rowcount() worked for me. See my PR #7 for a suggestion how to fix this for the recent peewee version.

sebo-b commented 2 years ago

Thanks for contributing