mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-13 22:32:15 +00:00
Decoupled the "reddit" application from the main program
This commit is contained in:
15
utils.py
15
utils.py
@@ -38,3 +38,18 @@ def dump(qs, outfile_path, model=None):
|
||||
row.append(val)
|
||||
writer.writerow(row)
|
||||
|
||||
|
||||
def installed(value):
|
||||
from django.conf import settings
|
||||
apps = settings.INSTALLED_APPS
|
||||
if "." in value:
|
||||
for app in apps:
|
||||
if app == value:
|
||||
return True
|
||||
else:
|
||||
for app in apps:
|
||||
fields = app.split(".")
|
||||
if fields[-1] == value:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user