diff options
Diffstat (limited to 'servo/views')
-rw-r--r-- | servo/views/device.py | 2 | ||||
-rw-r--r-- | servo/views/order.py | 2 | ||||
-rw-r--r-- | servo/views/product.py | 2 |
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)) |