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

Allow empty task id and osm id for new geopoint #1774

Merged
merged 4 commits into from
Sep 11, 2024

Conversation

Sujanadh
Copy link
Collaborator

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation
  • πŸ§‘β€πŸ’» Refactor
  • βœ… Test
  • πŸ€– Build or CI
  • ❓ Other (please specify)

Related Issue

Describe this PR

This PR now allows the empty task_id and osm_id for new entity created when user locate new geopoint for a feature in field. It is dependent to osm-fieldwork where xls file is updated to allow to create new entity for the gps point of new feature recorded.

Screenshots

N/A

Alternative Approaches Considered

Did you attempt any other approaches that are not documented in code?

Review Guide

  • Use the xlsx form updated in osm-fieldwork
  • create submission recording geopoint for new feature
  • check the entity status and submission count

Checklist before requesting a review

[optional] What gif best describes this PR or how it makes you feel?

@Sujanadh Sujanadh added the dependency:osm-fieldwork Requires updates in osm-fieldwork label Sep 10, 2024
@Sujanadh Sujanadh self-assigned this Sep 10, 2024
@github-actions github-actions bot added enhancement New feature or request backend Related to backend code labels Sep 10, 2024
@Sujanadh
Copy link
Collaborator Author

ps: this PR doesn't affect existing feature

@Sujanadh
Copy link
Collaborator Author

Updates:

  • decided to populate task_id through form using save_to method.


# convert empty str task_id and osm_id to None
# when new entities are created task_id and osm_id will be empty
if "task_id" in flattened_dict and flattened_dict["task_id"] == "":
Copy link
Member

Choose a reason for hiding this comment

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

An easier way to write this is with .get on a python dict πŸ‘

if flattened_dict.get("task_id", "") == "":

@spwoodcock spwoodcock merged commit 609f95f into development Sep 11, 2024
9 checks passed
@spwoodcock spwoodcock deleted the feat/geopoint-status branch September 11, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code dependency:osm-fieldwork Requires updates in osm-fieldwork enhancement New feature or request frontend Related to frontend code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants