Skip to content

get_params method should seek at 0 on the file stream #39

@chfw

Description

@chfw

continuing with #26, explicit seeking at 0 on the file stream could help avoid #37.

def get_params(self, **keywords):
    extension = self.name.split(".")[-1]
    keywords['file_type'] = extension
    self.file.seek(0) # <--
    content = self.file.read()
    if content:
        keywords['file_content'] = content
    else:
        raise IOError("No content was uploaded.")
    return keywords

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions