UniversalScientificTechnologies / OpenIntranet

Software for warehouse and production management
https://universalscientifictechnologies.github.io/OpenIntranet/
GNU General Public License v3.0
0 stars 2 forks source link

Nelze vytvořit pracovní smlouva u nového uživatele, chybějící pole v DB #114

Closed roman-dvorak closed 2 years ago

roman-dvorak commented 3 years ago

Nový uživatel automaticky nemá v DB vytvořené pole workpans. Při pokusu o tvorbu smlouvy je toto pole (z neznámého důvodu) požadováno.

-> checking conflicts, other contracts: []
-> checking hour rates, other contracts: []
-> checking hour rates, other contracts: []
-> zaji??uji existenci slo?ky na owncloudu
-> hotovo za 1.52 sekund
-> nahr?v?m soubor na owncloud
-> soubor nahr?n za 4.42 sekund

    HTTPServerRequest(protocol='http', host='127.0.0.1:10030', method='POST', uri='/users/api/u/5f899e0f12875025eccea86d/contracts/finalize', version='HTTP/1.0', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/dist-packages/tornado/web.py", line 1590, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/data/ust/OpenIntranet/src/OpenIntranet/plugins/users/backend/users.py", line 461, in post
        contract_id)
      File "/data/ust/OpenIntranet/src/OpenIntranet/plugins/helpers/mdoc_ops.py", line 45, in update_workspans_contract_id
        "$lt": to_date,
      File "/usr/lib/python3/dist-packages/pymongo/collection.py", line 976, in update_one
        session=session),
      File "/usr/lib/python3/dist-packages/pymongo/collection.py", line 836, in _update_retryable
        _update, session)
      File "/usr/lib/python3/dist-packages/pymongo/mongo_client.py", line 1102, in _retryable_write
        return self._retry_with_session(retryable, func, s, None)
      File "/usr/lib/python3/dist-packages/pymongo/mongo_client.py", line 1079, in _retry_with_session
        return func(session, sock_info, retryable)
      File "/usr/lib/python3/dist-packages/pymongo/collection.py", line 832, in _update
        retryable_write=retryable_write)
      File "/usr/lib/python3/dist-packages/pymongo/collection.py", line 798, in _update
        _check_write_command_response(result)
      File "/usr/lib/python3/dist-packages/pymongo/helpers.py", line 207, in _check_write_command_response
        _raise_last_write_error(write_errors)
      File "/usr/lib/python3/dist-packages/pymongo/helpers.py", line 189, in _raise_last_write_error
        raise WriteError(error.get("errmsg"), error.get("code"), error)
    pymongo.errors.WriteError: The path 'workspans' must exist in the document in order to apply array updates.

Tento případ byl vyřešen ručním vytvořením prázdného pole v DB.