PEP8 formatting fixes

This commit is contained in:
Garret Wassermann 2018-10-15 13:56:54 -04:00
parent fc028334d9
commit 2b11a0e11a
2 changed files with 11 additions and 9 deletions

View File

@ -344,6 +344,7 @@ ORDER_COLUMN_CHOICES = Choices(
('8', 'assigned_to')
)
def query_tickets_by_args(objects, order_by, **kwargs):
"""
This function takes in a list of ticket objects from the views and throws it
@ -370,13 +371,13 @@ def query_tickets_by_args(objects, order_by, **kwargs):
if search_value:
queryset = queryset.filter(Q(id__icontains=search_value) |
Q(priority__icontains=search_value) |
Q(title__icontains=search_value) |
Q(queue__title__icontains=search_value) |
Q(status__icontains=search_value) |
Q(created__icontains=search_value) |
Q(due_date__icontains=search_value) |
Q(assigned_to__email__icontains=search_value))
Q(priority__icontains=search_value) |
Q(title__icontains=search_value) |
Q(queue__title__icontains=search_value) |
Q(status__icontains=search_value) |
Q(created__icontains=search_value) |
Q(due_date__icontains=search_value) |
Q(assigned_to__email__icontains=search_value))
count = queryset.count()
queryset = queryset.order_by(order_column)[start:start + length]
@ -385,4 +386,4 @@ def query_tickets_by_args(objects, order_by, **kwargs):
'count': count,
'total': total,
'draw': draw
}
}

View File

@ -10,6 +10,7 @@ datatables for ticket_list.html. Called from staff.datatables_ticket_list.
"""
class TicketSerializer(serializers.ModelSerializer):
ticket = serializers.SerializerMethodField()
assigned_to = serializers.SerializerMethodField()
@ -24,7 +25,7 @@ class TicketSerializer(serializers.ModelSerializer):
fields = ('ticket', 'id', 'priority', 'title', 'queue', 'status', 'created', 'due_date', 'assigned_to', 'row_class')
def get_ticket(self, obj):
return (str(obj.id)+" "+obj.ticket)
return (str(obj.id) + " " + obj.ticket)
def get_status(self, obj):
return (obj.get_status)