This performs a database call, so you probably don't want it top-level, otherwise it's performed when the module is loaded.  You could make it a memoized function call so that it's called in the celery task.