{"action":"closed","issue":{"url":"https://api.github.com/repos/4teamwork/opengever.core/issues/4565","repository_url":"https://api.github.com/repos/4teamwork/opengever.core","labels_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/4565/labels{/name}","comments_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/4565/comments","events_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/4565/events","html_url":"https://github.com/4teamwork/opengever.core/issues/4565","id":339488151,"node_id":"MDU6SXNzdWUzMzk0ODgxNTE=","number":4565,"title":"Submitted documents are not cleaned up when rejecting proposals.","user":{"login":"deiferni","id":736583,"node_id":"MDQ6VXNlcjczNjU4Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/736583?v=4","gravatar_id":"","url":"https://api.github.com/users/deiferni","html_url":"https://github.com/deiferni","followers_url":"https://api.github.com/users/deiferni/followers","following_url":"https://api.github.com/users/deiferni/following{/other_user}","gists_url":"https://api.github.com/users/deiferni/gists{/gist_id}","starred_url":"https://api.github.com/users/deiferni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deiferni/subscriptions","organizations_url":"https://api.github.com/users/deiferni/orgs","repos_url":"https://api.github.com/users/deiferni/repos","events_url":"https://api.github.com/users/deiferni/events{/privacy}","received_events_url":"https://api.github.com/users/deiferni/received_events","type":"User","site_admin":false},"labels":[{"id":776632642,"node_id":"MDU6TGFiZWw3NzY2MzI2NDI=","url":"https://api.github.com/repos/4teamwork/opengever.core/labels/Aufwand:%20S%20(Stunden)","name":"Aufwand: S (Stunden)","color":"c2e0c6","default":false},{"id":38017512,"node_id":"MDU6TGFiZWwzODAxNzUxMg==","url":"https://api.github.com/repos/4teamwork/opengever.core/labels/Bug","name":"Bug","color":"b60205","default":false},{"id":765602932,"node_id":"MDU6TGFiZWw3NjU2MDI5MzI=","url":"https://api.github.com/repos/4teamwork/opengever.core/labels/Komplexit%C3%A4t:%20Mittel","name":"Komplexität: Mittel","color":"fbca04","default":false},{"id":182839909,"node_id":"MDU6TGFiZWwxODI4Mzk5MDk=","url":"https://api.github.com/repos/4teamwork/opengever.core/labels/SPV","name":"SPV","color":"c5def5","default":false}],"state":"closed","locked":false,"assignee":{"login":"deiferni","id":736583,"node_id":"MDQ6VXNlcjczNjU4Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/736583?v=4","gravatar_id":"","url":"https://api.github.com/users/deiferni","html_url":"https://github.com/deiferni","followers_url":"https://api.github.com/users/deiferni/followers","following_url":"https://api.github.com/users/deiferni/following{/other_user}","gists_url":"https://api.github.com/users/deiferni/gists{/gist_id}","starred_url":"https://api.github.com/users/deiferni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deiferni/subscriptions","organizations_url":"https://api.github.com/users/deiferni/orgs","repos_url":"https://api.github.com/users/deiferni/repos","events_url":"https://api.github.com/users/deiferni/events{/privacy}","received_events_url":"https://api.github.com/users/deiferni/received_events","type":"User","site_admin":false},"assignees":[{"login":"deiferni","id":736583,"node_id":"MDQ6VXNlcjczNjU4Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/736583?v=4","gravatar_id":"","url":"https://api.github.com/users/deiferni","html_url":"https://github.com/deiferni","followers_url":"https://api.github.com/users/deiferni/followers","following_url":"https://api.github.com/users/deiferni/following{/other_user}","gists_url":"https://api.github.com/users/deiferni/gists{/gist_id}","starred_url":"https://api.github.com/users/deiferni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deiferni/subscriptions","organizations_url":"https://api.github.com/users/deiferni/orgs","repos_url":"https://api.github.com/users/deiferni/repos","events_url":"https://api.github.com/users/deiferni/events{/privacy}","received_events_url":"https://api.github.com/users/deiferni/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/4teamwork/opengever.core/milestones/47","html_url":"https://github.com/4teamwork/opengever.core/milestone/47","labels_url":"https://api.github.com/repos/4teamwork/opengever.core/milestones/47/labels","id":3205948,"node_id":"MDk6TWlsZXN0b25lMzIwNTk0OA==","number":47,"title":"Release 2018.4","description":"","creator":{"login":"deiferni","id":736583,"node_id":"MDQ6VXNlcjczNjU4Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/736583?v=4","gravatar_id":"","url":"https://api.github.com/users/deiferni","html_url":"https://github.com/deiferni","followers_url":"https://api.github.com/users/deiferni/followers","following_url":"https://api.github.com/users/deiferni/following{/other_user}","gists_url":"https://api.github.com/users/deiferni/gists{/gist_id}","starred_url":"https://api.github.com/users/deiferni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deiferni/subscriptions","organizations_url":"https://api.github.com/users/deiferni/orgs","repos_url":"https://api.github.com/users/deiferni/repos","events_url":"https://api.github.com/users/deiferni/events{/privacy}","received_events_url":"https://api.github.com/users/deiferni/received_events","type":"User","site_admin":false},"open_issues":29,"closed_issues":232,"state":"open","created_at":"2018-03-21T10:54:15Z","updated_at":"2018-07-18T09:32:34Z","due_on":"2018-08-10T07:00:00Z","closed_at":null},"comments":0,"created_at":"2018-07-09T15:03:43Z","updated_at":"2018-07-18T09:32:34Z","closed_at":"2018-07-18T09:32:34Z","author_association":"MEMBER","body":"Reproduce:\r\n- Submit a Proposal with an `ftw.mail.mail` attachment\r\n- Reject the proposal\r\n- Re-Submit the Proposal\r\n- 💥 \r\n\r\n```\r\n2018-07-09 16:58:43 ERROR Zope.SiteErrorLog 1531148323.270.507083718675 http://localhost:8080/fd/ordnungssystem/fuehrung/kommunikation/allgemeines/dossier-22/proposal-8/addtransitioncomment\r\nTraceback (innermost last):\r\n  Module ZPublisher.Publish, line 146, in publish\r\n  Module Zope2.App.startup, line 303, in commit\r\n  Module transaction._manager, line 89, in commit\r\n  Module transaction._transaction, line 323, in commit\r\n  Module transaction._transaction, line 393, in _callBeforeCommitHooks\r\n  Module collective.indexing.transactions, line 52, in before_commit\r\n  Module collective.indexing.queue, line 165, in process\r\n  Module collective.indexing.indexer, line 80, in reindex\r\n  Module collective.indexing.indexer, line 57, in reindex\r\n  Module opengever.base.monkey.patches.cmf_catalog_aware, line 77, in reindexObject\r\n  Module Products.CMFCore.CMFCatalogAware, line 88, in reindexObject\r\n  Module Products.CMFCore.CatalogTool, line 301, in reindexObject\r\n  Module Products.CMFPlone.CatalogTool, line 349, in catalog_object\r\n  Module Products.ZCatalog.ZCatalog, line 476, in catalog_object\r\n  Module Products.ZCatalog.Catalog, line 347, in catalogObject\r\n  Module Products.ZCatalog.Catalog, line 292, in updateMetadata\r\n  Module Products.ZCatalog.Catalog, line 413, in recordify\r\n  Module plone.indexer.wrapper, line 63, in __getattr__\r\n  Module plone.indexer.delegate, line 20, in __call__\r\n  Module opengever.base.indexes, line 12, in referenceIndexer\r\n  Module opengever.base.reference, line 27, in get_number\r\n  Module opengever.base.reference, line 58, in get_parent_numbers\r\n  Module opengever.base.reference, line 45, in append_local_number\r\n  Module opengever.base.reference, line 72, in get_local_number\r\n  Module opengever.ogds.base.utils, line 128, in get_current_admin_unit\r\n  Module opengever.ogds.models.service, line 60, in fetch_admin_unit\r\n  Module sqlalchemy.orm.query, line 864, in get\r\n  Module sqlalchemy.orm.query, line 897, in _get_impl\r\n  Module sqlalchemy.orm.loading, line 223, in load_on_ident\r\n  Module sqlalchemy.orm.query, line 2814, in one\r\n  Module sqlalchemy.orm.query, line 2784, in one_or_none\r\n  Module sqlalchemy.orm.query, line 2854, in __iter__\r\n  Module sqlalchemy.orm.session, line 1428, in _autoflush\r\n  Module sqlalchemy.util.compat, line 203, in raise_from_cause\r\n  Module sqlalchemy.orm.session, line 1418, in _autoflush\r\n  Module sqlalchemy.orm.session, line 2209, in flush\r\n  Module sqlalchemy.orm.session, line 2329, in _flush\r\n  Module sqlalchemy.util.langhelpers, line 66, in __exit__\r\n  Module sqlalchemy.orm.session, line 2293, in _flush\r\n  Module sqlalchemy.orm.unitofwork, line 389, in execute\r\n  Module sqlalchemy.orm.unitofwork, line 548, in execute\r\n  Module sqlalchemy.orm.persistence, line 181, in save_obj\r\n  Module sqlalchemy.orm.persistence, line 835, in _emit_insert_statements\r\n  Module sqlalchemy.engine.base, line 945, in execute\r\n  Module sqlalchemy.sql.elements, line 263, in _execute_on_connection\r\n  Module sqlalchemy.engine.base, line 1053, in _execute_clauseelement\r\n  Module sqlalchemy.engine.base, line 1189, in _execute_context\r\n  Module sqlalchemy.engine.base, line 1402, in _handle_dbapi_exception\r\n  Module sqlalchemy.util.compat, line 203, in raise_from_cause\r\n  Module sqlalchemy.engine.base, line 1182, in _execute_context\r\n  Module sqlalchemy.engine.default, line 470, in do_execute\r\nIntegrityError: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely) (psycopg2.IntegrityError) duplicate key value violates unique constraint \"ix_s_docs_unique_src\"\r\nDETAIL:  Key (admin_unit_id, int_id, proposal_id)=(fd, 359739970, 19) already exists.\r\n [SQL: \"INSERT INTO submitteddocuments (id, admin_unit_id, int_id, proposal_id, submitted_version, submitted_admin_unit_id, submitted_int_id, submitted_physical_path) VALUES (nextval('submitteddocument_id_seq'), %(admin_unit_id)s, %(int_id)s, %(proposal_id)s, %(submitted_version)s, %(submitted_admin_unit_id)s, %(submitted_int_id)s, %(submitted_physical_path)s) RETURNING submitteddocuments.id\"] [parameters: {'submitted_int_id': 873799055, 'admin_unit_id': u'fd', 'submitted_physical_path': u'sitzungen/committee-3/submitted-proposal-19/document-64', 'submitted_version': 0, 'proposal_id': 19, 'int_id': 359739970, 'submitted_admin_unit_id': u'fd'}]\r\n```\r\n\r\nSolution:\r\nWhen rejecting a proposal, also remove the entries in the `submitteddocuments` table for the attachments of the proposal."}}
{"actor":{"display_login":"deiferni"}}