aboutsummaryrefslogtreecommitdiffstats
path: root/servo/views
diff options
context:
space:
mode:
Diffstat (limited to 'servo/views')
-rw-r--r--servo/views/order.py8
-rw-r--r--servo/views/product.py2
2 files changed, 4 insertions, 6 deletions
diff --git a/servo/views/order.py b/servo/views/order.py
index 4db8c4a..b6fae0a 100644
--- a/servo/views/order.py
+++ b/servo/views/order.py
@@ -31,9 +31,7 @@ from servo.forms.orders import *
from servo.forms.repairs import StatusForm
from servo.models import Note, User, Device, Customer
-from servo.models.common import (Tag,
- FlaggedItem,
- GsxAccount,)
+from servo.models.common import (Tag, FlaggedItem, GsxAccount,)
from servo.models.repair import (Checklist,
ChecklistItem,
Repair,
@@ -93,7 +91,7 @@ def prepare_list_view(request, args):
if args.get("spec"):
spec = args['spec'][0]
- if spec is "None":
+ if spec == "None":
orders = orders.filter(devices=None)
else:
orders = orders.filter(devices__slug=spec)
@@ -742,7 +740,7 @@ def add_part(request, pk, device, code):
try:
tag, created = TaggedItem.objects.get_or_create(
- ref="product",
+ content_type__model="product",
object_id=product.pk,
tag=device.description
)
diff --git a/servo/views/product.py b/servo/views/product.py
index 47b9018..4c7f96f 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(ref="product")
+ tags = TaggedItem.objects.filter(content_type__model="product")
tags = tags.distinct("tag").values_list("tag", flat=True)
return json_response(list(tags))