Intevation / intelmq-fody

Web interface to IntelMQ
9 stars 3 forks source link

Org cannot be saved if sector_id was filled by mistake #35

Closed dmth closed 7 years ago

dmth commented 7 years ago

When editing an organisation, it cannot be saved if something has been typed into the field sector_id and was deleted again.

ErrorLog:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/contactdb_api/serve.py", line 1006, in commit_pending_org_changes
    results.append((command, known_commands[command](org)))
  File "/usr/local/lib/python3.4/dist-packages/contactdb_api/serve.py", line 865, in _update_org
    _db_manipulate(operation_str, org, False)
  File "/usr/local/lib/python3.4/dist-packages/contactdb_api/serve.py", line 193, in _db_manipulate
    cur.execute(operation, parameters)
  File "/usr/local/lib/python3.4/dist-packages/psycopg2/extras.py", line 249, in execute
    return super(RealDictCursor, self).execute(query, vars)
psycopg2.DataError: invalid input syntax for integer: ""
LINE 5: ...NAMEOFORG', '', '4711'...
                        ^

The json Object contains a sector_id': '' now but sector_id': None is expected.

bernhardreiter commented 7 years ago

Workaround: scratch the pending Org and restart editing.

bernhardreiter commented 7 years ago

Fixed when using contactdb_api https://github.com/Intevation/intelmq-mailgen/commit/f991123ab61bcbed19c97df2a05b3aa3837668d9