'Handle creating/editing the Extension instance and saving it to db,
as well as file operations, from a FileUpload instance. Can throw
a ParseError or SigningError, so should always be called within a
try/except.'

@classmethod
def from_upload(cls, upload, user=None):

    manifest_contents = cls.extract_and_validate_upload(upload)
    data = cls.extract_manifest_fields(manifest_contents)
    default_language = data['default_language']
    name = data['name'][default_language]
    if user.extension_set.without_deleted().filter(name__locale=default_language, name__localized_string=name).exists():
        raise ParseError(_(u'An    Add-on    with    the    same    name    already    exists    in    your    submissions.'))
    instance = cls.objects.create(**data)
    instance.authors.add(user)
    version = ExtensionVersion.from_upload(upload, parent=instance, manifest_contents=manifest_contents)
    if ('icons' in manifest_contents):
        fetch_icon.delay(instance.pk, version.pk)
    return instance
