superdesk/superdesk-server — pull request #464 by sivakuna-aap (2014-12-22 04:46:35+00:00)
Title: While fetching from ingest archive_ingest fails to insert initial version of the document in archive_versions.

Analysis:

Versioning is not enabled for Ingest resource and also resource definition has no projection attribute. While registering Ingest resource with domain, flask adds default projection to Ingest resource. Default projection will have the fields specified in schema attribute. Because of this querying on Ingest resource will not return "_version" as part of response even though the collection has that attribute, Because of missing "_version" attribute archive_ingest fails to insert document into archive_versions.

Solution:
Although versioning wasn't enabled for Ingest resource, superdesk inserts "_version" attribute. This is removed and inserting "_version" attribute while fetching. Also modified behave tests of fetching in archive_ingest.feature to check for "_version" after fetching.