From 2e73a74b2376da2b6a2bc8ef41c7cbd00ba63033 Mon Sep 17 00:00:00 2001 From: David Paul Graham Date: Thu, 16 Jun 2022 13:01:49 -0500 Subject: [PATCH 1/9] initial PullManifest APIView with post method --- apps/api/urls.py | 2 ++ apps/api/views.py | 32 +++++++++++++++++++++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/apps/api/urls.py b/apps/api/urls.py index 729d4c522..edf6dd149 100644 --- a/apps/api/urls.py +++ b/apps/api/urls.py @@ -8,6 +8,8 @@ path('manifest/', views.ManifestView.as_view()), # site path('handler/', views.HandlerView.as_view()), + # rcrainfo integration actions + path('rcrainfo/manifest-pull', views.PullManifest.as_view()), # other path('sync/', views.SyncSiteManifest.as_view(), name='sync'), path('tran/', views.TransporterView.as_view()) diff --git a/apps/api/views.py b/apps/api/views.py index 983af8dc3..981d46420 100644 --- a/apps/api/views.py +++ b/apps/api/views.py @@ -1,11 +1,15 @@ import http +import os from django.core.exceptions import ObjectDoesNotExist +from emanifest import client as em +from rest_framework import status from rest_framework.exceptions import APIException from rest_framework.request import Request from rest_framework.response import Response from rest_framework.views import APIView +from apps.accounts.models import Profile from apps.trak.models import Handler, Manifest, Transporter from lib.rcrainfo import rcrainfo @@ -35,7 +39,7 @@ def get(self, request: Request, mtn: str = None) -> Response: def post(self, request: Request, mtn: str = None) -> Response: if not mtn: - return self.response(status=400) + return self.response(status=status.HTTP_400_BAD_REQUEST) else: serializer = ManifestSerializer(data=request.data) valid = serializer.is_valid() @@ -46,7 +50,7 @@ def post(self, request: Request, mtn: str = None) -> Response: return self.response(status=500) -# trash to be fixed, can't be bothered to remove it right now +# trash, not time remove it right now class SyncSiteManifest(APIView): response = Response @@ -55,7 +59,7 @@ def get(self, request: Request, epa_id: str = None) -> Response: resp = rcrainfo.get_mtns(epa_id) return Response(data={'mtn': resp.json}) else: - return self.response(status=200) + return self.response(status=status.HTTP_200_OK) class HandlerView(APIView): @@ -88,3 +92,25 @@ def get(self, request: Request, tran_id: int = None) -> Response: except ObjectDoesNotExist: return self.response(status=http.HTTPStatus.NOT_FOUND, data={'Error': f'{tran_id} not found'}) + + +# ToDo authentication, right now will work as long as user is signed +# into haztrak via the browser for demo purposes. Just Demo! +class PullManifest(APIView): + if os.getenv('RCRAINFO_ENV'): + ri_client = em.new_client(os.getenv('RCRAINFO_ENV')) + else: + ri_client = em.new_client('preprod') + + def post(self, request: Request) -> Response: + try: + user_profile = Profile.objects.get(user_id=self.request.user) + self.ri_client.Auth(user_profile.rcra_api_id, user_profile.rcra_api_key) + data = {'mtn': []} + for mtn in self.request.data['mtn']: + resp = self.ri_client.GetManByMTN(mtn) + data['mtn'].append({mtn: resp.response.status_code}) + print(data) + return Response(status=status.HTTP_200_OK, data=data) + except KeyError: + return Response(status=status.HTTP_400_BAD_REQUEST) From 8f9de02d2ee857b7467563a6ee117edd4df3e5c3 Mon Sep 17 00:00:00 2001 From: David Paul Graham Date: Thu, 16 Jun 2022 14:40:16 -0500 Subject: [PATCH 2/9] manifest-pull endpoint pulls manifest from rcrainfo by mtn passed by array --- apps/api/serializers/address.py | 1 + apps/api/serializers/manifest/manifest.py | 73 +++++++++++++++-------- apps/api/views.py | 7 +++ 3 files changed, 57 insertions(+), 24 deletions(-) diff --git a/apps/api/serializers/address.py b/apps/api/serializers/address.py index 49ceb31f7..df18fd271 100644 --- a/apps/api/serializers/address.py +++ b/apps/api/serializers/address.py @@ -33,6 +33,7 @@ def to_representation(self, value) -> dict: class AddressSerializer(TrakSerializer): streetNumber = serializers.CharField( source='street_number', + required=False, ) state = LocalityField('state') country = LocalityField('country') diff --git a/apps/api/serializers/manifest/manifest.py b/apps/api/serializers/manifest/manifest.py index a3e8e4532..fdeb0e6dc 100644 --- a/apps/api/serializers/manifest/manifest.py +++ b/apps/api/serializers/manifest/manifest.py @@ -19,88 +19,113 @@ class ManifestSerializer(TrakSerializer): createdDate = serializers.DateTimeField( - source='created_date') + source='created_date', + ) updatedDate = serializers.DateTimeField( - source='update_date') + source='update_date', + ) manifestTrackingNumber = serializers.CharField( - source='mtn') + source='mtn', + ) # status submissionType = serializers.CharField( - source='submission_type') + source='submission_type', + ) signatureStatus = serializers.BooleanField( source='signature_status', allow_null=True, - default=False) + default=False, + ) originType = serializers.CharField( - source='origin_type') + source='origin_type', + ) shippedDate = serializers.DateTimeField( - source='shipped_date') + source='shipped_date', + required=False, + ) potentialShipDate = serializers.CharField( - source='potential_ship_date') + source='potential_ship_date', + required=False, + ) receivedDate = serializers.DateTimeField( - source='received_date') + source='received_date', + required=False, + ) certifiedDate = serializers.DateTimeField( source='certified_date', allow_null=True, - default=None) + default=None, + ) certifiedBy = serializers.JSONField( source='certified_by', allow_null=True, - default=None) + default=None, + ) generator = HandlerSerializer() transporters = TransporterSerializer(many=True) designatedFacility = HandlerSerializer( - source='tsd') + source='tsd', + ) # broker wastes = WasteLineSerializer(many=True) # rejection rejectionInfo = serializers.JSONField( source='rejection_info', allow_null=True, - default=None) + default=None, + ) # discrepancy # residue residueNewManifestTrackingNumbers = serializers.JSONField( source='residue_new_mtn', - default=[]) + default=[], + ) # import, see .to_representation() and .to_internal_value() methods importInfo = serializers.JSONField( source='import_info', allow_null=True, - default=None) + default=None, + ) containsPreviousRejectOrResidue = serializers.BooleanField( - source='contains_residue_or_rejection') + source='contains_residue_or_rejection', + ) printedDocument = serializers.JSONField( source='printed_document', allow_null=True, - default=None) + default=None, + ) formDocument = serializers.JSONField( source='form_document', allow_null=True, - default=None) + default=None, + ) additionalInfo = serializers.JSONField( source='additional_info', allow_null=True, - default=None) + default=None, + ) correctionInfo = serializers.JSONField( source='correction_info', allow_null=True, - default=None) - + default=None, + ) ppcStatus = serializers.JSONField( source='ppc_status', allow_null=True, - default=None) + default=None, + ) # mtnValidationInfo # provideImageGeneratorInfo locked = serializers.BooleanField( allow_null=True, - default=False) + default=False, + ) lockedReason = serializers.CharField( source='locked_reason', allow_null=True, - default=None) + default=None, + ) def create(self, validated_data) -> Manifest: # pop foreign table data diff --git a/apps/api/views.py b/apps/api/views.py index 981d46420..b4051132a 100644 --- a/apps/api/views.py +++ b/apps/api/views.py @@ -110,6 +110,13 @@ def post(self, request: Request) -> Response: for mtn in self.request.data['mtn']: resp = self.ri_client.GetManByMTN(mtn) data['mtn'].append({mtn: resp.response.status_code}) + if Manifest.objects.filter(mtn=mtn): + print('manifest exists') + pass + else: + new_manifest = ManifestSerializer(data=resp.json) + new_manifest.is_valid() + new_manifest.save() print(data) return Response(status=status.HTTP_200_OK, data=data) except KeyError: From 169638c50e68d1663269062fb499cbc5927abb74 Mon Sep 17 00:00:00 2001 From: David Paul Graham Date: Thu, 16 Jun 2022 15:30:30 -0500 Subject: [PATCH 3/9] error msg for users without api ID and Key --- apps/api/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/api/views.py b/apps/api/views.py index b4051132a..31ba8d10b 100644 --- a/apps/api/views.py +++ b/apps/api/views.py @@ -105,6 +105,10 @@ class PullManifest(APIView): def post(self, request: Request) -> Response: try: user_profile = Profile.objects.get(user_id=self.request.user) + if not user_profile.rcra_api_id and user_profile.rcra_api_key: + return Response(status=status.HTTP_401_UNAUTHORIZED, data={ + "msg": f'user {user_profile} RCRAInfo API ID and Key ' + f'no found, add them to your profile'}) self.ri_client.Auth(user_profile.rcra_api_id, user_profile.rcra_api_key) data = {'mtn': []} for mtn in self.request.data['mtn']: @@ -117,7 +121,6 @@ def post(self, request: Request) -> Response: new_manifest = ManifestSerializer(data=resp.json) new_manifest.is_valid() new_manifest.save() - print(data) return Response(status=status.HTTP_200_OK, data=data) except KeyError: return Response(status=status.HTTP_400_BAD_REQUEST) From 9c9f0c4f8be101ae9427f9254b6785023db5f6e8 Mon Sep 17 00:00:00 2001 From: David Paul Graham Date: Thu, 16 Jun 2022 16:14:47 -0500 Subject: [PATCH 4/9] adjust ManifestSerializer .create method to point to Handler instance if epa_id already exists --- apps/api/serializers/manifest/manifest.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/api/serializers/manifest/manifest.py b/apps/api/serializers/manifest/manifest.py index fdeb0e6dc..2938ff13f 100644 --- a/apps/api/serializers/manifest/manifest.py +++ b/apps/api/serializers/manifest/manifest.py @@ -9,7 +9,7 @@ from rest_framework import serializers -from apps.trak.models import Manifest, WasteLine +from apps.trak.models import Handler, Manifest, WasteLine from ..base import TrakSerializer from ..handler import HandlerSerializer @@ -134,8 +134,14 @@ def create(self, validated_data) -> Manifest: tsd_data = validated_data.pop('tsd') gen_data = validated_data.pop('generator') # Secondary foreign table data - gen_object = self.create_handler(**gen_data) - tsd_object = self.create_handler(**tsd_data) + if Handler.objects.filter(epa_id=gen_data['epa_id']).exists(): + gen_object = Handler.objects.get(epa_id=gen_data['epa_id']) + else: + gen_object = self.create_handler(**gen_data) + if Handler.objects.filter(epa_id=tsd_data['epa_id']).exists(): + tsd_object = Handler.objects.get(epa_id=tsd_data['epa_id']) + else: + tsd_object = self.create_handler(**tsd_data) # Create model instances manifest = Manifest.objects.create(generator=gen_object, From 818540abfca0fc1cebcd443c4b09de8c14c5556b Mon Sep 17 00:00:00 2001 From: David Paul Graham Date: Fri, 17 Jun 2022 09:01:43 -0500 Subject: [PATCH 5/9] reorg api views to internal and external --- apps/api/views/__init__.py | 2 + apps/api/{views.py => views/external.py} | 53 +--------------------- apps/api/views/internal.py | 56 ++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 51 deletions(-) create mode 100644 apps/api/views/__init__.py rename apps/api/{views.py => views/external.py} (58%) create mode 100644 apps/api/views/internal.py diff --git a/apps/api/views/__init__.py b/apps/api/views/__init__.py new file mode 100644 index 000000000..b70776029 --- /dev/null +++ b/apps/api/views/__init__.py @@ -0,0 +1,2 @@ +from .external import HandlerView, ManifestView, TransporterView +from .internal import PullManifest, SyncSiteManifest diff --git a/apps/api/views.py b/apps/api/views/external.py similarity index 58% rename from apps/api/views.py rename to apps/api/views/external.py index 31ba8d10b..715d49666 100644 --- a/apps/api/views.py +++ b/apps/api/views/external.py @@ -1,20 +1,15 @@ import http -import os from django.core.exceptions import ObjectDoesNotExist -from emanifest import client as em from rest_framework import status from rest_framework.exceptions import APIException from rest_framework.request import Request from rest_framework.response import Response from rest_framework.views import APIView -from apps.accounts.models import Profile +from apps.api.serializers import (HandlerSerializer, ManifestSerializer, + TransporterSerializer) from apps.trak.models import Handler, Manifest, Transporter -from lib.rcrainfo import rcrainfo - -from .serializers import (HandlerSerializer, ManifestSerializer, - TransporterSerializer) class ManifestView(APIView): @@ -50,18 +45,6 @@ def post(self, request: Request, mtn: str = None) -> Response: return self.response(status=500) -# trash, not time remove it right now -class SyncSiteManifest(APIView): - response = Response - - def get(self, request: Request, epa_id: str = None) -> Response: - if epa_id: - resp = rcrainfo.get_mtns(epa_id) - return Response(data={'mtn': resp.json}) - else: - return self.response(status=status.HTTP_200_OK) - - class HandlerView(APIView): response = Response @@ -92,35 +75,3 @@ def get(self, request: Request, tran_id: int = None) -> Response: except ObjectDoesNotExist: return self.response(status=http.HTTPStatus.NOT_FOUND, data={'Error': f'{tran_id} not found'}) - - -# ToDo authentication, right now will work as long as user is signed -# into haztrak via the browser for demo purposes. Just Demo! -class PullManifest(APIView): - if os.getenv('RCRAINFO_ENV'): - ri_client = em.new_client(os.getenv('RCRAINFO_ENV')) - else: - ri_client = em.new_client('preprod') - - def post(self, request: Request) -> Response: - try: - user_profile = Profile.objects.get(user_id=self.request.user) - if not user_profile.rcra_api_id and user_profile.rcra_api_key: - return Response(status=status.HTTP_401_UNAUTHORIZED, data={ - "msg": f'user {user_profile} RCRAInfo API ID and Key ' - f'no found, add them to your profile'}) - self.ri_client.Auth(user_profile.rcra_api_id, user_profile.rcra_api_key) - data = {'mtn': []} - for mtn in self.request.data['mtn']: - resp = self.ri_client.GetManByMTN(mtn) - data['mtn'].append({mtn: resp.response.status_code}) - if Manifest.objects.filter(mtn=mtn): - print('manifest exists') - pass - else: - new_manifest = ManifestSerializer(data=resp.json) - new_manifest.is_valid() - new_manifest.save() - return Response(status=status.HTTP_200_OK, data=data) - except KeyError: - return Response(status=status.HTTP_400_BAD_REQUEST) diff --git a/apps/api/views/internal.py b/apps/api/views/internal.py new file mode 100644 index 000000000..700585930 --- /dev/null +++ b/apps/api/views/internal.py @@ -0,0 +1,56 @@ +import os + +from emanifest import client as em +from rest_framework import status +from rest_framework.request import Request +from rest_framework.response import Response +from rest_framework.views import APIView + +from apps.accounts.models import Profile +from apps.api.serializers import ManifestSerializer +from apps.trak.models import Manifest +from lib.rcrainfo import rcrainfo + + +# ToDo authentication, right now will work as long as user is signed +# into haztrak via the browser for demo purposes. Just Demo! +class PullManifest(APIView): + if os.getenv('RCRAINFO_ENV'): + ri_client = em.new_client(os.getenv('RCRAINFO_ENV')) + else: + ri_client = em.new_client('preprod') + + def post(self, request: Request) -> Response: + try: + user_profile = Profile.objects.get(user_id=self.request.user) + if not user_profile.rcra_api_id and user_profile.rcra_api_key: + return Response(status=status.HTTP_401_UNAUTHORIZED, data={ + "msg": f'user {user_profile} RCRAInfo API ID and Key ' + f'no found, add them to your profile'}) + self.ri_client.Auth(user_profile.rcra_api_id, user_profile.rcra_api_key) + data = {'mtn': []} + for mtn in self.request.data['mtn']: + resp = self.ri_client.GetManByMTN(mtn) + data['mtn'].append({mtn: resp.response.status_code}) + if Manifest.objects.filter(mtn=mtn): + print('manifest exists') + pass + else: + new_manifest = ManifestSerializer(data=resp.json) + new_manifest.is_valid() + new_manifest.save() + return Response(status=status.HTTP_200_OK, data=data) + except KeyError: + return Response(status=status.HTTP_400_BAD_REQUEST) + + +# trash, not time remove it right now +class SyncSiteManifest(APIView): + response = Response + + def get(self, request: Request, epa_id: str = None) -> Response: + if epa_id: + resp = rcrainfo.get_mtns(epa_id) + return Response(data={'mtn': resp.json}) + else: + return self.response(status=status.HTTP_200_OK) From f35b66fe3c08f384640066734fd9862cb97427ea Mon Sep 17 00:00:00 2001 From: David Paul Graham Date: Fri, 17 Jun 2022 09:36:20 -0500 Subject: [PATCH 6/9] manifest-pull reverse URL name, Pull Manifests button and modal --- apps/api/urls.py | 2 +- apps/api/views/internal.py | 5 ++-- apps/trak/templates/trak/site_manifests.html | 27 ++++++++++++++++++-- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/apps/api/urls.py b/apps/api/urls.py index edf6dd149..e0dfb054b 100644 --- a/apps/api/urls.py +++ b/apps/api/urls.py @@ -9,7 +9,7 @@ # site path('handler/', views.HandlerView.as_view()), # rcrainfo integration actions - path('rcrainfo/manifest-pull', views.PullManifest.as_view()), + path('rcrainfo/manifest-pull', views.PullManifest.as_view(), name='manifest-pull'), # other path('sync/', views.SyncSiteManifest.as_view(), name='sync'), path('tran/', views.TransporterView.as_view()) diff --git a/apps/api/views/internal.py b/apps/api/views/internal.py index 700585930..205dac9fd 100644 --- a/apps/api/views/internal.py +++ b/apps/api/views/internal.py @@ -33,7 +33,8 @@ def post(self, request: Request) -> Response: resp = self.ri_client.GetManByMTN(mtn) data['mtn'].append({mtn: resp.response.status_code}) if Manifest.objects.filter(mtn=mtn): - print('manifest exists') + # ToDo update manifest if already downloaded + # see ManifestSerializer .update method pass else: new_manifest = ManifestSerializer(data=resp.json) @@ -41,7 +42,7 @@ def post(self, request: Request) -> Response: new_manifest.save() return Response(status=status.HTTP_200_OK, data=data) except KeyError: - return Response(status=status.HTTP_400_BAD_REQUEST) + return Response(status=status.HTTP_500_INTERNAL_SERVER_ERROR) # trash, not time remove it right now diff --git a/apps/trak/templates/trak/site_manifests.html b/apps/trak/templates/trak/site_manifests.html index 1159cd108..40e115f06 100644 --- a/apps/trak/templates/trak/site_manifests.html +++ b/apps/trak/templates/trak/site_manifests.html @@ -13,11 +13,34 @@

{{ site }} Manifests

-
+ + + + {% if gen_manifests %}
From 231b43c9027c6ae17a638fa6de24febd1546329d Mon Sep 17 00:00:00 2001 From: David Paul Graham Date: Fri, 17 Jun 2022 12:52:12 -0500 Subject: [PATCH 7/9] prototype frontend manifest-pull --- apps/api/views/internal.py | 18 +++++++------- apps/trak/templates/trak/site_manifests.html | 25 ++++++++++++++++++-- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/apps/api/views/internal.py b/apps/api/views/internal.py index 205dac9fd..8464bc37e 100644 --- a/apps/api/views/internal.py +++ b/apps/api/views/internal.py @@ -32,14 +32,16 @@ def post(self, request: Request) -> Response: for mtn in self.request.data['mtn']: resp = self.ri_client.GetManByMTN(mtn) data['mtn'].append({mtn: resp.response.status_code}) - if Manifest.objects.filter(mtn=mtn): - # ToDo update manifest if already downloaded - # see ManifestSerializer .update method - pass - else: - new_manifest = ManifestSerializer(data=resp.json) - new_manifest.is_valid() - new_manifest.save() + if resp.response.status_code == 200: + if Manifest.objects.filter(mtn=mtn): + # ToDo update manifest if already downloaded + # see ManifestSerializer .update method + pass + else: + new_manifest = ManifestSerializer(data=resp.json) + new_manifest.is_valid() + new_manifest.save() + print(data) return Response(status=status.HTTP_200_OK, data=data) except KeyError: return Response(status=status.HTTP_500_INTERNAL_SERVER_ERROR) diff --git a/apps/trak/templates/trak/site_manifests.html b/apps/trak/templates/trak/site_manifests.html index 40e115f06..60bf6df56 100644 --- a/apps/trak/templates/trak/site_manifests.html +++ b/apps/trak/templates/trak/site_manifests.html @@ -26,20 +26,41 @@

{{ site }} Manifests

+ {% if gen_manifests %} From 2087d471cda1898ce0bffa31ca13b9835c0fb20b Mon Sep 17 00:00:00 2001 From: David Paul Graham Date: Wed, 22 Jun 2022 11:34:38 -0400 Subject: [PATCH 8/9] prototype outputPullMtn displays the results from pull MTN API add getCookie function from django docs --- apps/trak/templates/trak/site_manifests.html | 22 ++----- static/js/trak/manifest-pull.js | 62 ++++++++++++++++++++ 2 files changed, 68 insertions(+), 16 deletions(-) create mode 100644 static/js/trak/manifest-pull.js diff --git a/apps/trak/templates/trak/site_manifests.html b/apps/trak/templates/trak/site_manifests.html index 60bf6df56..546d5af02 100644 --- a/apps/trak/templates/trak/site_manifests.html +++ b/apps/trak/templates/trak/site_manifests.html @@ -35,6 +35,11 @@
Receiving Facility
+ {% endblock content %} diff --git a/static/js/trak/manifest-pull.js b/static/js/trak/manifest-pull.js new file mode 100644 index 000000000..99fee3eb0 --- /dev/null +++ b/static/js/trak/manifest-pull.js @@ -0,0 +1,62 @@ +// Todo A lot can be improved here, this is mostly prototype code at best :| + +function pullMtn() { + const mtnInput = document.getElementById("pullMtnInput").value + const csrfToken = getCookie('csrftoken'); + let mtnArray = mtnInput.split(" ") + let data = {'mtn': mtnArray} + const options = { + "method": 'POST', + "body": JSON.stringify(data), + "headers": { + "Content-Type": "application/json", + "X-CSRFToken": csrfToken + } + } + fetch("http://127.0.0.1:8000/api/rcrainfo/manifest-pull", options) + .then(response => response.json()) + .then(response => outputPullMtn(response)) + .catch(err => console.log(err)) +} + +function outputPullMtn(response) { + let pullMtnRespList = document.getElementById("pullMtnRespList") + response.mtn.forEach((mtn) => { + let li = document.createElement("li") + li.classList.add("d-flex") + li.classList.add("justify-content-between") + let newMtn = document.createElement("p") + newMtn.innerText = Object.keys(mtn)[0] + li.appendChild(newMtn) + if (mtn[Object.keys(mtn)[0]] === 200) { + let newMtnStatus = document.createElement("i") + newMtnStatus.classList.add("fa-solid") + newMtnStatus.classList.add("fa-circle-check") + newMtnStatus.classList.add("text-success") + li.appendChild(newMtnStatus) + } else { + let newMtnStatus = document.createElement("i") + newMtnStatus.classList.add("fa-solid") + newMtnStatus.classList.add("fa-circle-xmark") + newMtnStatus.classList.add("text-danger") + li.appendChild(newMtnStatus) + } + pullMtnRespList.appendChild(li) + }) +} + +// Comes from Django docs here https://docs.djangoproject.com/en/4.0/ref/csrf/ +function getCookie(name) { + let cookieValue = null; + if (document.cookie && document.cookie !== '') { + const cookies = document.cookie.split(';'); + for (let i = 0; i < cookies.length; i++) { + const cookie = cookies[i].trim(); + if (cookie.substring(0, name.length + 1) === (name + '=')) { + cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); + break; + } + } + } + return cookieValue; +} From 283341f7fa9aee554d5d6420fa4e6014063c1ece Mon Sep 17 00:00:00 2001 From: David Paul Graham Date: Wed, 22 Jun 2022 11:50:30 -0400 Subject: [PATCH 9/9] Clean up and style fixings little clean up style fixings for inline element --- apps/api/views/internal.py | 1 - apps/trak/templates/trak/site_manifests.html | 9 ++++--- static/js/trak/manifest-pull.js | 27 ++++++++++---------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/apps/api/views/internal.py b/apps/api/views/internal.py index 8464bc37e..48ae71710 100644 --- a/apps/api/views/internal.py +++ b/apps/api/views/internal.py @@ -41,7 +41,6 @@ def post(self, request: Request) -> Response: new_manifest = ManifestSerializer(data=resp.json) new_manifest.is_valid() new_manifest.save() - print(data) return Response(status=status.HTTP_200_OK, data=data) except KeyError: return Response(status=status.HTTP_500_INTERNAL_SERVER_ERROR) diff --git a/apps/trak/templates/trak/site_manifests.html b/apps/trak/templates/trak/site_manifests.html index 546d5af02..7fe34977f 100644 --- a/apps/trak/templates/trak/site_manifests.html +++ b/apps/trak/templates/trak/site_manifests.html @@ -25,7 +25,7 @@

{{ site }} Manifests

aria-hidden="true">