aboutsummaryrefslogtreecommitdiffstats
path: root/servo/views
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2021-05-13 07:52:47 +0300
committerFilipp Lepalaan <filipp@mac.com>2021-05-13 07:52:47 +0300
commit1c4284366f0f82240e57a7a45fd9c4bd63941390 (patch)
tree617b1cd99a7859438d8b8aa2ded3583fde953561 /servo/views
parent98b8e9006e2cfdf155c2789393251d77ef027161 (diff)
downloadServo-1c4284366f0f82240e57a7a45fd9c4bd63941390.tar.gz
Servo-1c4284366f0f82240e57a7a45fd9c4bd63941390.tar.bz2
Servo-1c4284366f0f82240e57a7a45fd9c4bd63941390.zip
Bring back contenttypes
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))