Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AmandaBirmingham committed Sep 23, 2020
1 parent 82c5494 commit 9224f08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions microsetta_private_api/admin/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,8 @@ def _set_up_and_query_projects(self, t, is_active_val):
insert into barcodes.barcode_scans
(barcode, scan_timestamp, sample_status)
VALUES ('000070796', '2020-09-01', 'no-registered-account');
UPDATE barcodes.project SET is_active = FALSE
UPDATE barcodes.project SET is_active = FALSE
WHERE project_id = 2;
"""
with t.cursor() as cur:
Expand Down
8 changes: 4 additions & 4 deletions microsetta_private_api/repo/admin_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
{p.BRANDING_ASSOC_INSTRUCTIONS_KEY},
{p.BRANDING_STATUS_KEY},
{p.SUBPROJECT_NAME_KEY}, {p.ALIAS_KEY},
{p.SPONSOR_KEY}, {p.COORDINATION_KEY},
{p.SPONSOR_KEY}, {p.COORDINATION_KEY},
{p.IS_ACTIVE_KEY}"""

PROJECTS_BASICS_SQL = f"""
Expand Down Expand Up @@ -593,14 +593,14 @@ def get_projects(self, is_active_val=None):
projects will be returned regardless of active status.
"""


# read all kinds of project info and computed counts from the db
# into a pandas data frame
projects_df = self._read_projects_df_from_db()

# if an active value has been provided, look only at project records
# that have that active value.
if not is_active_val is None:
# that have that active value. NB this has to be a test against None,
# not against "false-ish" (if not is_active_val)
if is_active_val is not None:
is_active_val_mask = projects_df[p.IS_ACTIVE_KEY] == is_active_val
filtered_df = projects_df.loc[is_active_val_mask]
projects_df = filtered_df
Expand Down

0 comments on commit 9224f08

Please sign in to comment.