Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Update PPE filter checkbox label / allow viewing RequestLog in the Django admin / log matching traceback #1049

Merged
merged 4 commits into from Jul 20, 2020

Conversation

jwalgran
Copy link
Contributor

@jwalgran jwalgran commented Jul 15, 2020

Overview

Makes 2 small changes discussed and implemented during a weekly status call and a third change to help future debugging of matching failures.

Demo

Screen Shot 2020-07-15 at 1 02 51 PM

Screen Shot 2020-07-15 at 1 02 16 PM

Screen Shot 2020-07-15 at 1 02 26 PM

Screen Shot 2020-07-16 at 9 34 16 AM

Testing Instructions

diff --git a/src/django/api/views.py b/src/django/api/views.py
index 38ff127..8d164bf 100644
--- a/src/django/api/views.py
+++ b/src/django/api/views.py
@@ -1064,6 +1064,7 @@ class FacilitiesViewSet(mixins.ListModelMixin,
 
         match_started = str(datetime.utcnow())
         try:
+            raise Exception('boom')
             match_results = match_item(country_code, name, address, item.id)
             match_objects = save_match_details(match_results)
 
{
"country": "US",
"name": "ABC Textiles",
"address": "1 Main St New York 13662"
}
  • Verify that ERROR_MATCHING is returned
  • In the admin browser session browse https://openapparel.org/admin/api/facilitylistitem/, select the most recent item (which should have an error status), and verify that the traceback is included at the end of the "Processing resuslts" JSON array.

Checklist

  • fixup! commits have been squashed
  • CI passes after rebase
  • CHANGELOG.md updated with summary of features or fixes, following Keep a Changelog guidelines

Text change requested by project owners.
We add the `RequestLog` model to the Django admin so project owners can keep
tabs on API usage in real time. `RequestLog` entries are designed to be readonly
so we disabled all editing functionality in the `ModelAdmin` subclass.
Allow for easier debugging of failures in the matching process by logging the
full stack trace.
@jwalgran jwalgran changed the title Update PPE filter checkbox label and allow viewing RequestLog in the Django admin Update PPE filter checkbox label / allow viewing RequestLog in the Django admin / log matching traceback Jul 16, 2020
@jwalgran jwalgran requested a review from rajadain July 16, 2020 16:44
@jwalgran jwalgran assigned jwalgran and rajadain and unassigned jwalgran Jul 16, 2020
@rajadain
Copy link
Contributor

Taking a look now

Copy link
Contributor

@rajadain rajadain left a comment

Choose a reason for hiding this comment

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

+1 tested, works well. Some of the later testing instructions referenced openapparel.org, but I did everything on localhost. Nice work!

@rajadain rajadain assigned jwalgran and unassigned rajadain Jul 16, 2020
@jwalgran
Copy link
Contributor Author

Thanks for the review.

@jwalgran jwalgran merged commit 1ecbbc1 into develop Jul 20, 2020
@jwalgran jwalgran deleted the feature/jcw/small-updates branch July 20, 2020 15:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants