Storage/S3: Add missing DISTINCT to query

This commit is contained in:
Adrian Moennich 2018-11-09 17:40:42 +01:00
parent 55d4de2efb
commit f75fd081ff
2 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ class RHBuckets(RH):
def _get_dynamic_info(self, backend_name, storage):
buckets = set()
for model in StoredFileMixin.__subclasses__():
query = (db.session.query(db.func.split_part(model.storage_file_id, '//', 1))
query = (db.session.query(db.func.split_part(model.storage_file_id, '//', 1).distinct())
.filter(model.storage_file_id.isnot(None), model.storage_backend == backend_name))
buckets.update(bucket for bucket, in query)

View File

@ -21,7 +21,7 @@ from setuptools import find_packages, setup
setup(
name='indico-plugin-storage-s3',
version='2.0',
version='2.0.1',
description='S3 storage backend for Indico',
url='https://github.com/indico/indico-plugins',
license='https://www.gnu.org/licenses/gpl-3.0.txt',