diff options
author | zsloan | 2020-06-26 14:47:10 -0500 |
---|---|---|
committer | zsloan | 2020-06-26 14:47:10 -0500 |
commit | aa06c83ecd4d36878ac0aadd75ab2bd461f44344 (patch) | |
tree | 32cb2183111fb180401daeff8fc0e1a7b5f9a1e9 /wqflask | |
parent | 7e683d7d3f770b2d30c4b2a3c0e1f1c4fd4d75b5 (diff) | |
download | genenetwork2-aa06c83ecd4d36878ac0aadd75ab2bd461f44344.tar.gz |
Removed collections with zero members from list and count of user collections
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/templates/collections/list.html | 2 | ||||
-rw-r--r-- | wqflask/wqflask/user_session.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/wqflask/wqflask/templates/collections/list.html b/wqflask/wqflask/templates/collections/list.html index c8705c7d..94e22c4d 100644 --- a/wqflask/wqflask/templates/collections/list.html +++ b/wqflask/wqflask/templates/collections/list.html @@ -42,6 +42,7 @@ <tbody> {% for uc in collections %} + {% if uc.num_members > 0 %} <tr class="collection_line"> <td align="center" style="padding: 0px;"><INPUT TYPE="checkbox" NAME="collection" class="checkbox trait_checkbox" VALUE="{{ uc.id }}"></td> <td align="right">{{ loop.index }} @@ -50,6 +51,7 @@ <td>{{ uc.changed_timestamp }}</td> <td align="right">{{ uc.num_members }}</td> </tr> + {% endif %} {% endfor %} </tbody> </table> diff --git a/wqflask/wqflask/user_session.py b/wqflask/wqflask/user_session.py index ec6d4ae3..ba659fe5 100644 --- a/wqflask/wqflask/user_session.py +++ b/wqflask/wqflask/user_session.py @@ -167,7 +167,7 @@ class UserSession(object): def num_collections(self): """Number of user's collections""" - return len(self.user_collections) + return len([item for item in self.user_collections if item['num_members'] > 0]) def add_collection(self, collection_name, traits): """Add collection into Redis""" |