DEP: Add emergency api endpoint#2723
Draft
sudip-khanal wants to merge 4 commits intoproject/dref-emergency-pagesfrom
Draft
DEP: Add emergency api endpoint#2723sudip-khanal wants to merge 4 commits intoproject/dref-emergency-pagesfrom
sudip-khanal wants to merge 4 commits intoproject/dref-emergency-pagesfrom
Conversation
susilnem
requested changes
Apr 28, 2026
- Add Enum for event sources. - Add source field in place of auto generated source field on event model. - Migrate existing event records to enum type. - Update related serializers and tests.
- Add new emergency api for. - Attach latest field report. - Add test case for emergency endpoint.
fd14a97 to
efb86d8
Compare
susilnem
requested changes
May 4, 2026
|
|
||
| def handle(self, *args, **options): | ||
| guids = [e.auto_generated_source for e in Event.objects.filter(auto_generated_source__startswith="www.who.int")] | ||
| guids = [e.source for e in Event.objects.filter(source=Event.EventSource.WHO)] |
Member
There was a problem hiding this comment.
Can you confirm this? It looks like GUIDs are being used for mapping, but they might not match when scraping from the source.
Comment on lines
+25
to
+26
| Event.objects.bulk_update(to_update, ["source", "auto_generated"]) | ||
| self.stdout.write(self.style.SUCCESS("Event sources have been updated successfully.")) |
Member
There was a problem hiding this comment.
Suggested change
| Event.objects.bulk_update(to_update, ["source", "auto_generated"]) | |
| self.stdout.write(self.style.SUCCESS("Event sources have been updated successfully.")) | |
| updated_events = Event.objects.bulk_update(to_update, ["source", "auto_generated"]) | |
| self.stdout.write(self.style.SUCCESS(f"Total {updated_events} Events sources have been updated successfully.")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Checklist
Things that should succeed before merging.
Release
If there is a version update, make sure to tag the repository with the latest version.