'The manifest has updated, update the version and file.
This is intended to be used for hosted apps only, which have only a
single version and a single file.'

def manifest_updated(self, manifest, upload):

    data = parse_addon(upload, self)
    manifest = WebAppParser().get_json_data(upload)
    version = self.versions.latest()
    max_ = Version._meta.get_field_by_name('_developer_name')[0].max_length
    version.update(version=data['version'], _developer_name=data['developer_name'][:max_])
    try:
        version.manifest_json.update(manifest=json.dumps(manifest))
    except AppManifest.DoesNotExist:
        AppManifest.objects.create(version=version, manifest=json.dumps(manifest))
    path = smart_path(nfd_str(upload.path))
    file = version.files.latest()
    file.filename = file.generate_filename(extension='.webapp')
    file.size = private_storage.size(path)
    file.hash = file.generate_hash(path)
    log.info(('Updated    file    hash    to    %s' % file.hash))
    file.save()
    copy_stored_file(path, os.path.join(version.path_prefix, nfd_str(file.filename)), src_storage=private_storage, dst_storage=private_storage)
    log.info(('[Webapp:%s]    Copied    updated    manifest    to    %s' % (self, version.path_prefix)))
    mkt.log(mkt.LOG.MANIFEST_UPDATED, self)
