From 90aca5102180e2a81f07c9b3fb6f0582ec4d6326 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Wed, 11 May 2016 11:19:09 +0200 Subject: [PATCH] Add a load_preferences method in the util module This can then be used for caching the users' preferences in the consumer or the worker. --- fmn/consumer/util.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fmn/consumer/util.py b/fmn/consumer/util.py index 8183dc9..f8b0d6c 100644 --- a/fmn/consumer/util.py +++ b/fmn/consumer/util.py @@ -36,3 +36,12 @@ def get_fas_email(config, username): except Exception: log.exception("Failed to get FAS email for %r" % username) return '%s@fedoraproject.org' % username + + +def load_preferences(args): + session, config, valid_paths = args + return fmn.lib.load_preferences( + session, config, valid_paths, + cull_disabled=True, + cull_backends=['desktop'] + )