lib: add ifapp-like function

This commit is contained in:
Jens Langhammer 2018-11-22 13:12:36 +01:00
parent 20752b4382
commit 849f9c9251
1 changed files with 5 additions and 0 deletions

View File

@ -23,3 +23,8 @@ def get_apps():
for _app in apps.get_app_configs(): for _app in apps.get_app_configs():
if _app.name.startswith('passbook'): if _app.name.startswith('passbook'):
yield _app yield _app
def app(name):
"""Return true if app with `name` is enabled"""
from django.conf import settings
return name in settings.INSTALLED_APPS