##// 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 try:
165 try:
166 repo = ScmModel().get_repo(repo_name)
166 repo = ScmModel().get_repo(repo_name)
167 cs = repo.get_changeset(revision)
167 cs = repo.get_changeset(revision)
168 content_type = ARCHIVE_SPECS[fileformat][0]
168 except ChangesetDoesNotExistError:
169 except ChangesetDoesNotExistError:
169 return _('Unknown revision %s') % revision
170 return _('Unknown revision %s') % revision
170 except EmptyRepositoryError:
171 except EmptyRepositoryError:
171 return _('Empty repository')
172 return _('Empty repository')
172 except InproperArchiveTypeError:
173 except (InproperArchiveTypeError, KeyError):
173 return _('Unknown archive type')
174 return _('Unknown archive type')
174
175
175 fname = '%s-%s%s' % (repo_name, revision, ext)
176 response.content_type = content_type
176
177 response.content_disposition = 'attachment; filename=%s-%s%s' \
177 response.content_type = ARCHIVE_SPECS[fileformat][0]
178 % (repo_name, revision, ext)
178 response.content_disposition = 'attachment; filename=%s' % fname
179
179
180 return cs.get_chunked_archive(kind=fileformat)
180 return cs.get_chunked_archive(kind=fileformat)
181
181
General Comments 0
You need to be logged in to leave comments. Login now