Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/api/tasks/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def delete(self, project_id):
tasks_ids = request.get_json().get("tasks")
if tasks_ids is None:
return {"Error": "Tasks ids not provided", "SubCode": "InvalidData"}, 400
if type(tasks_ids) != list:
if isinstance(tasks_ids, list) is False:
return {
"Error": "Tasks were not provided as a list",
"SubCode": "InvalidData",
Expand Down
6 changes: 3 additions & 3 deletions backend/models/dtos/project_dto.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

def is_known_project_status(value):
"""Validates that Project Status is known value"""
if type(value) == list:
if isinstance(value, list):
return # Don't validate the entire list, just the individual values

try:
Expand All @@ -55,7 +55,7 @@ def is_known_project_priority(value):

def is_known_mapping_type(value):
"""Validates Mapping Type is known value"""
if type(value) == list:
if isinstance(value, list):
return # Don't validate the entire list, just the individual values

try:
Expand All @@ -70,7 +70,7 @@ def is_known_mapping_type(value):

def is_known_editor(value):
"""Validates Editor is known value"""
if type(value) == list:
if isinstance(value, list):
return # Don't validate the entire list, just the individual values

try:
Expand Down
2 changes: 1 addition & 1 deletion backend/models/postgis/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ def as_dto(
task_dto.task_history = task_history
task_dto.last_updated = last_updated if last_updated else None
task_dto.auto_unlock_seconds = Task.auto_unlock_delta().total_seconds()
task_dto.comments_number = comments if type(comments) == int else None
task_dto.comments_number = comments if isinstance(comments, int) else None
return task_dto

def as_dto_with_instructions(self, preferred_locale: str = "en") -> TaskDTO:
Expand Down
Loading