aboutsummaryrefslogtreecommitdiffstats
path: root/servo/views
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2021-05-13 00:03:23 +0300
committerFilipp Lepalaan <filipp@mac.com>2021-05-13 00:03:23 +0300
commit86c04e60b932b8051cde013396aec84a35eff871 (patch)
tree045510f7cd7101662fb8a7e807956a5910060ed2 /servo/views
parent6514971850a070bd4aeb27aba85e319b852cbd97 (diff)
downloadServo-86c04e60b932b8051cde013396aec84a35eff871.tar.gz
Servo-86c04e60b932b8051cde013396aec84a35eff871.tar.bz2
Servo-86c04e60b932b8051cde013396aec84a35eff871.zip
Django 3 fixes
Diffstat (limited to 'servo/views')
-rw-r--r--servo/views/device.py2
-rw-r--r--servo/views/order.py2
-rw-r--r--servo/views/product.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/servo/views/device.py b/servo/views/device.py
index dd69414..f02182a 100644
--- a/servo/views/device.py
+++ b/servo/views/device.py
@@ -55,7 +55,7 @@ def prep_list_view(request, product_line=None, model=None):
product_lines = gsxws.products.models()
if product_line is None:
- product_line = product_lines.keys()[0]
+ product_line = list(product_lines.keys())[0]
models = model_from_slug(product_line)
diff --git a/servo/views/order.py b/servo/views/order.py
index ff1c216..4db8c4a 100644
--- a/servo/views/order.py
+++ b/servo/views/order.py
@@ -742,7 +742,7 @@ def add_part(request, pk, device, code):
try:
tag, created = TaggedItem.objects.get_or_create(
- content_type__model="product",
+ ref="product",
object_id=product.pk,
tag=device.description
)
diff --git a/servo/views/product.py b/servo/views/product.py
index 4c7f96f..47b9018 100644
--- a/servo/views/product.py
+++ b/servo/views/product.py
@@ -82,7 +82,7 @@ def tags(request):
Returns all product tags
"""
from servo.lib.utils import json_response
- tags = TaggedItem.objects.filter(content_type__model="product")
+ tags = TaggedItem.objects.filter(ref="product")
tags = tags.distinct("tag").values_list("tag", flat=True)
return json_response(list(tags))