louking / members

member activity management
Other
1 stars 2 forks source link

Members view: check for interest before processing #500

Open louking opened 2 years ago

louking commented 2 years ago

With checking input, we get the following

Message type:       ERROR
Location:           /var/www/www.members.loutilities.com/venv/lib64/python3.6/site-packages/loutilities/tables.py:753
Module:             tables
Function:           wrapped_f
Time:               2022-02-11 16:31:16,565
User:               *************************

Message:

Traceback (most recent call last):
  File "/var/www/www.members.loutilities.com/venv/lib64/python3.6/site-packages/loutilities/tables.py", line 730, in wrapped_f
    f(self,*args, **kwargs)
  File "/var/www/www.members.loutilities.com/venv/lib64/python3.6/site-packages/loutilities/tables.py", line 1269, in post
    self.do_post()
  File "/var/www/www.members.loutilities.com/venv/lib64/python3.6/site-packages/loutilities/tables.py", line 1280, in do_post
    thisrow = self.createrow(thisdata)
  File "/var/www/www.members.loutilities.com/venv/lib64/python3.6/site-packages/loutilities/user/views/userrole.py", line 181, in createrow
    interests = [Interest.query.filter_by(id=id).one() for id in formdata['interests']['id'].split(SEPARATOR)]
  File "/var/www/www.members.loutilities.com/venv/lib64/python3.6/site-packages/loutilities/user/views/userrole.py", line 181, in <listcomp>
    interests = [Interest.query.filter_by(id=id).one() for id in formdata['interests']['id'].split(SEPARATOR)]
  File "/var/www/www.members.loutilities.com/venv/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 3500, in one
    raise orm_exc.NoResultFound("No row was found for one()")
sqlalchemy.orm.exc.NoResultFound: No row was found for one()