IEEE.org     |     IEEE Xplore Digital Library     |     IEEE Standards     |     IEEE Spectrum     |     More Sites

Verified Commit b4ff9456 authored by Emi Simpson's avatar Emi Simpson
Browse files

[api] Fix inexplicable incorrect linter warning

parent 29a4a12e
Pipeline #1079 passed with stage
in 48 seconds
......@@ -1315,11 +1315,12 @@ class _PopulateSources(NamedTuple):
projects: Mapping[ProjectInfo, Collection[UserInfo]]
def get_query(self) -> QueryRequest:
if self.projects:
slots: str = str('%s,' * len(self.projects))
return QueryRequest(f'''
-- Make sure that these fields reflect SourceInfo
SELECT source_id, project_id, data_type, data_url, flagged
FROM data_sources
WHERE project_id IN ({("%s," * len(self.projects))[:-1]});
WHERE project_id IN ({slots[:-1]});
''', [p.project_id for p in self.projects])
else:
# Nothing to do, don't bother talking to the database
......@@ -1367,12 +1368,13 @@ class FillProjectInfo(NamedTuple):
projects: Collection[ProjectInfo]
def get_query(self) -> QueryRequest:
if self.projects:
slots = str('%s,' * len(self.projects))
return QueryRequest(f'''
-- Make sure that these fields reflect SourceInfo
SELECT project_id, user_id, username, first_name, last_name
FROM users
NATURAL JOIN owners
WHERE project_id IN ({("%s," * len(self.projects))[:-1]});
WHERE project_id IN ({slots[:-1]});
''', [p.project_id for p in self.projects])
else:
# If there aren't any projects, why bother talking to the database
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment