Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if facet_type == 'layers':
return facets
maps = Map.objects.filter(title__icontains=title_filter)
documents = Document.objects.filter(title__icontains=title_filter)
if not settings.SKIP_PERMS_FILTER:
maps = maps.filter(id__in=authorized)
documents = documents.filter(id__in=authorized)
facets['map'] = maps.count()
facets['document'] = documents.count()
if facet_type == 'home':
facets['user'] = get_user_model().objects.exclude(
username='AnonymousUser').count()
facets['app'] = App.objects.count()
facets['group'] = GroupProfile.objects.exclude(
access="private").count()
facets['layer'] = facets['raster'] + \
facets['vector'] + facets['remote']
return facets
angular.forEach(app.store.installedApps.objects,
function(installedApp{
var currentApp = appsHash[installedApp.name];
if(dependents.indexOf(currentApp) == -1 &&
currentApp.latest_version.dependencies[app.name]){
dependents.push(currentApp)
_getDependents(currentApp, appsHash, dependents)
}
});
:return:
"""
with lock:
uninstalled = False
installed_apps = App.objects.all()
for app in installed_apps:
app_installer = AppInstaller(
app.name, self.store.id, app.version, user=self.user)
dependencies = self.version.dependencies.get_attributes() \
if app_installer.version else {}
if self.name in dependencies.keys():
app_installer.uninstall(restart=False)
self.completely_remove()
uninstalled = True
if restart:
RestartHelper.restart_server()
return uninstalled
if facet_type == 'layers':
return facets
maps = Map.objects.filter(title__icontains=title_filter)
documents = Document.objects.filter(title__icontains=title_filter)
if not settings.SKIP_PERMS_FILTER:
maps = maps.filter(id__in=authorized)
documents = documents.filter(id__in=authorized)
facets['map'] = maps.count()
facets['document'] = documents.count()
if facet_type == 'home':
facets['user'] = get_user_model().objects.exclude(
username='AnonymousUser').count()
facets['app'] = App.objects.count()
facets['group'] = GroupProfile.objects.exclude(
access="private").count()
facets['layer'] = facets['raster'] + \
facets['vector'] + facets['remote']
return facets
def apps(request):
return {'apps': App.objects.all().order_by('order')}