Skip to content

Commit

Permalink
Merge pull request #6011 from hotosm/dependency/flake8-6.1.0
Browse files Browse the repository at this point in the history
Bump flake8 from 6.0.0 to 6.1.0
  • Loading branch information
Aadesh-Baral authored Aug 2, 2023
2 parents f04752d + 2c8343c commit 977133f
Show file tree
Hide file tree
Showing 6 changed files with 732 additions and 1,024 deletions.
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

0 comments on commit 977133f

Please sign in to comment.