Let generated links for 'unittest' backend actually be a valid link.

This commit is contained in:
Sybren A. Stüvel 2016-08-26 12:39:55 +02:00
parent dd6fc8bde4
commit 163db3f2b8

View File

@ -321,8 +321,10 @@ def generate_link(backend, file_path, project_id=None, is_public=False):
if backend == 'cdnsun':
return hash_file_path(file_path, None)
if backend == 'unittest':
return md5(file_path).hexdigest()
return 'https://unit.test/%s' % md5(file_path).hexdigest()
log.warning('generate_link(): Unknown backend %r, returning empty string as new link.',
backend)
return ''