Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a bug where editing causing an error lost the original form #7360

Merged
merged 2 commits into from Jul 8, 2015

Conversation

czue
Copy link
Member

@czue czue commented Jul 6, 2015

@dannyroberts - encountered this looking into something else

xforms[0] = instance
# this is usually just one document, but if an edit errored we want
# to save the deprecated form as well
XFormInstance.get_db().bulk_save(xforms)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before just the instance was saved, and the newly added deprecated form in the context just vanished.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, dear

@dannyroberts
Copy link
Member

The failure looks possibly real?

======================================================================
FAIL: testBadIndexReferenceDomain (casexml.apps.case.tests.test_indexes.IndexTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "corehq/ex-submodules/casexml/apps/case/tests/test_indexes.py", line 163, in testBadIndexReferenceDomain
    self.assertIsInstance(xform, XFormError)
AssertionError: XFormInstance(_attachments={'form.xml': {'data': u'PGRhdGEgeG1sbnM9Imh0dHBzOi8vd3d3LmNvbW1jYXJlaHEub3JnL3Rlc3QvY2FzZXhtbC13cmFwcGVyIiB4bWxuczpqcm09Imh0dHA6Ly9vcGVucm9zYS5vcmcvanIveGZvcm1zIj48Y2FzZSBjYXNlX2lkPSJjaGlsZC1jYXNlLWlkIiBkYXRlX21vZGlmaWVkPSIyMDE1LTA3LTA2IiB1c2VyX2lkPSJ0ZXN0LWluZGV4LXVzZXIiIHhtbG5zPSJodHRwOi8vY29tbWNhcmVocS5vcmcvY2FzZS90cmFuc2FjdGlvbi92MiI+PGNyZWF0ZT48Y2FzZV90eXBlIC8+PGNhc2VfbmFtZSAvPjxvd25lcl9pZCAvPjwvY3JlYXRlPjxpbmRleD48YmFkIGNhc2VfdHlwZT0iYmFkLWNhc2UiPnRleHQtaW5kZXgtbW90aGVyLWNhc2U8L2JhZD48L2luZGV4PjwvY2FzZT48L2RhdGE+', 'content_type': u'text/xml'}}, _id=u'e70d1201d08336e4580d508ce13c1c9d', _rev=u'1-8b58d7e91924da3a08f2d007c8ec7757', app_id=None, auth_context={'doc_type': u'DefaultAuthContext'}, build_id=None, computed_={}, computed_modified_on_=None, date_header=None, doc_type=u'XFormError', domain=u'child', export_tag=[u'domain', u'xmlns'], form={u'@xmlns': u'https://www.commcarehq.org/test/casexml-wrapper', u'case': {u'@xmlns': u'http://commcarehq.org/case/transaction/v2', u'index': {u'bad': {u'@case_type': u'bad-case', u'#text': u'text-index-mother-case'}}, u'@date_modified': datetime.date(2015, 7, 6), u'create': {u'case_type': u'', u'owner_id': u'', u'case_name': u''}, u'@user_id': u'test-index-user', u'@case_id': u'child-case-id'}, '#type': u'data'}, history=[], initial_processing_complete=False, last_sync_token=None, openrosa_headers={}, partial_submission=False, path=None, received_on=datetime.datetime(2015, 7, 6, 18, 45, 18, 60136), submit_ip=None, xmlns=u'https://www.commcarehq.org/test/casexml-wrapper', problem=u'IllegalCaseId: Bad case id') is not an instance of <class 'couchforms.models.XFormError'>
----------------------------------------------------------------------

@czue
Copy link
Member Author

czue commented Jul 7, 2015

yep, will fix

@czue
Copy link
Member Author

czue commented Jul 7, 2015

@dannyroberts

@czue
Copy link
Member Author

czue commented Jul 7, 2015

@TylerSheffels (since @dannyroberts is offline today)

sravfeyn added a commit that referenced this pull request Jul 8, 2015
fix a bug where editing causing an error lost the original form
@sravfeyn sravfeyn merged commit 3a614c9 into master Jul 8, 2015
@dannyroberts dannyroberts deleted the edit-submit-errors branch February 23, 2016 18:47
@snopoke snopoke restored the edit-submit-errors branch March 19, 2017 00:04
@dannyroberts dannyroberts deleted the edit-submit-errors branch March 22, 2017 14:56
@snopoke snopoke restored the edit-submit-errors branch March 2, 2018 17:39
@dannyroberts dannyroberts deleted the edit-submit-errors branch March 29, 2019 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants