Skip to content

Commit 642b755

Browse files
committed
Fix imports #504
Signed-off-by: Jono Yang <[email protected]>
1 parent edb0ef1 commit 642b755

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: minecode/api.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99

1010
import json
1111

12-
from django import http
1312
from django.contrib.auth import get_user_model
1413
from django.core import signing
1514
from django.db import transaction
15+
from django.http import Http404
16+
from django.shortcuts import get_object_or_404
1617
from django.utils import timezone
1718
from django.views.decorators.csrf import csrf_exempt
1819
from django.views.decorators.http import require_POST
20+
1921
from packageurl import PackageURL
2022
from rest_framework import serializers, status, viewsets
2123
from rest_framework.decorators import action
@@ -355,11 +357,11 @@ def send_scan_notification(request, key):
355357
try:
356358
json_data = json.loads(request.body.decode("utf-8"))
357359
except json.JSONDecodeError:
358-
raise http.Http404
360+
raise Http404
359361

360362
user_id = signing.loads(key)
361363
User = get_user_model()
362-
user = http.get_object_or_404(User, id=user_id)
364+
user = get_object_or_404(User, id=user_id)
363365

364366
results = json_data.get('results')
365367
summary = json_data.get('summary')
@@ -383,7 +385,7 @@ def send_scan_notification(request, key):
383385
with open(scan_summary_location, 'wb') as f:
384386
json.dump(summary, f)
385387

386-
scannable_uri = http.get_object_or_404(ScannableURI, uuid=scannable_uri_uuid)
388+
scannable_uri = get_object_or_404(ScannableURI, uuid=scannable_uri_uuid)
387389
scannable_uri.process_scan_results(
388390
scan_results_location=scan_results_location,
389391
scan_summary_location=scan_summary_location,

0 commit comments

Comments
 (0)