From 8fbf13b17c9a7c7a2c615a2e88c775a242c2b559 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Thu, 23 Jun 2016 08:47:11 -0600 Subject: [PATCH] Allow privileged code to get any and all accounts This is useful for testing. It requires specifying None rather than defaulting for safety --- vanth/platform/ofxaccount.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vanth/platform/ofxaccount.py b/vanth/platform/ofxaccount.py index 3b00b44..1c7b69f 100644 --- a/vanth/platform/ofxaccount.py +++ b/vanth/platform/ofxaccount.py @@ -18,9 +18,11 @@ def get(user_id): vanth.tables.OFXAccount.c.uuid, ]).where( vanth.tables.OFXAccount.c.source == vanth.tables.OFXSource.c.uuid - ).where( - vanth.tables.OFXAccount.c.owner == user_id ) + if user_id: + query = query.where( + vanth.tables.OFXAccount.c.owner == user_id + ) results = engine.execute(query) return [{ 'institution' : result[vanth.tables.OFXSource.c.name.label('institution')],