misc: remove some warnings (#77825)

This commit is contained in:
Lauréline Guérin 2023-05-25 14:42:23 +02:00
parent c8984c43fa
commit e7ba87844c
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
1 changed files with 3 additions and 3 deletions

View File

@ -138,7 +138,7 @@ class ProjectSummaryHistoryView(DetailView):
versions_and_day = {}
for installed in installed_versions:
installed_day = installed.timestamp.strftime('%Y-%m-%d')
if not installed_day in versions_and_day:
if installed_day not in versions_and_day:
versions_and_day[installed_day] = {'modules': {}, 'day': installed.timestamp.date()}
if installed.version.module.name in versions_and_day[installed_day]['modules']:
continue
@ -232,7 +232,7 @@ class ModuleDeploymentsView(TemplateView):
module = context['module']
for service in InstalledService.objects.all():
version = module.get_installed_version(service.platform, service.service)
if version and not version in context['versions']:
if version and version not in context['versions']:
if version.version.version:
context['versions'].append(version)
@ -246,7 +246,7 @@ def module_deployments_json(request, name, **kwargs):
module = Module.objects.get(name=name)
for service in InstalledService.objects.all():
version = module.get_installed_version(service.platform, service.service)
if version and not version in installed_versions:
if version and version not in installed_versions:
installed_versions.append(version)
json.dump(