##// END OF EJS Templates
fixed key error on unknown archival
marcink -
r950:343c28c3 beta
parent child Browse files
Show More
@@ -165,17 +165,17 b' class FilesController(BaseController):'
165 165 try:
166 166 repo = ScmModel().get_repo(repo_name)
167 167 cs = repo.get_changeset(revision)
168 content_type = ARCHIVE_SPECS[fileformat][0]
168 169 except ChangesetDoesNotExistError:
169 170 return _('Unknown revision %s') % revision
170 171 except EmptyRepositoryError:
171 172 return _('Empty repository')
172 except InproperArchiveTypeError:
173 except (InproperArchiveTypeError, KeyError):
173 174 return _('Unknown archive type')
174 175
175 fname = '%s-%s%s' % (repo_name, revision, ext)
176
177 response.content_type = ARCHIVE_SPECS[fileformat][0]
178 response.content_disposition = 'attachment; filename=%s' % fname
176 response.content_type = content_type
177 response.content_disposition = 'attachment; filename=%s-%s%s' \
178 % (repo_name, revision, ext)
179 179
180 180 return cs.get_chunked_archive(kind=fileformat)
181 181
General Comments 0
You need to be logged in to leave comments. Login now