From 23869d11fe7182331690171daf74b2a3478c5f6b Mon Sep 17 00:00:00 2001 From: Zishan Mirza Date: Wed, 9 Mar 2022 08:01:58 +0000 Subject: [PATCH] Size column This patch updates "CHANGELOG.md" and switches the condition in the "if" statement to "total_size". Signed-off-by: Zishan Mirza --- CHANGELOG.md | 1 + dds_web/api/project.py | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd190973f..febd49ea6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,3 +39,4 @@ Please add a _short_ line describing the PR you make, if the PR implements a spe - Include frontend build in the backend production target ([#1011](https://github.com/ScilifelabDataCentre/dds_web/pull/1011)) - Correct response about project being created when email validation fails for users ([#1014](https://github.com/ScilifelabDataCentre/dds_web/pull/1014)) - Introduced an additional validator `dds_web.utils.contains_disallowed_characters` to fix issue [#1007](https://github.com/scilifelabdatacentre/dds_web/issues/1007) ([#1021](https://github.com/ScilifelabDataCentre/dds_web/pull/1021)). +- Hides the "Size" and "total_size" variables according to the role and project status ([#1032](https://github.com/ScilifelabDataCentre/dds_web/pull/1032)). diff --git a/dds_web/api/project.py b/dds_web/api/project.py index 8e905a5f6..4f20db612 100644 --- a/dds_web/api/project.py +++ b/dds_web/api/project.py @@ -338,9 +338,7 @@ def get(self): }, } - if ( - current_user.role == "Researcher" and p.current_status == "Available" - ) or current_user.role != "Researcher": + if total_size: return_info["total_size"] = total_size return return_info