-
Notifications
You must be signed in to change notification settings - Fork 134
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
Add GeoJSON attachment params to EXPORT_OPTIONS #2757
base: main
Are you sure you want to change the base?
Conversation
affcf0c
to
db854a3
Compare
get_query_params_from_metadata(metadata), | ||
) | ||
|
||
metadata.delete() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FrankApiyo Instead of deleting and creating a new MetaData object, we can update metadata.extra_data
then do metadata.refresh_from_db()
@@ -349,6 +401,50 @@ def test_should_not_create_new_export_when_old_exists(self): | |||
Export.objects.get(xform=self.xform).options, | |||
) | |||
|
|||
# New metadata will yield a new export | |||
metadata.delete() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FrankApiyo Will updating metadata.extra_data
suffice instead of deleting and creating a new one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whenever you create a new linked dataset, a new metadata object is created; So creating a new metadata object more closely simulates what happens in production. (as compared to editing an existing metadata object)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FrankApiyo Noted. Though l believe since this is a unit test and not an integration test, we should only be interested in the metadata
passed to custom_response_handler
and not the larger context of how the MetaData
object is used
}, | ||
object_id=self.xform.id, | ||
) | ||
_response = custom_response_handler( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the variable _response
is unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This _response
variables might provide some implicit documentation by telling you that this custom_reponse_handler
returns a response object
Changes / Features implemented
EXPORT_OPTIONS
for GeoJSON exportsSteps taken to verify this change does what is intended
Side effects of implementing this change
N/A
Before submitting this PR for review, please make sure you have:
Closes #2752