Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
chfw opened this issue Jul 6, 2017 · 0 comments
Closed

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

chfw opened this issue Jul 6, 2017 · 0 comments

Comments

@chfw
Copy link
Member

chfw commented Jul 6, 2017

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant