we can reduce the repetition by putting the `content_type` assignment outside the `if`,

```python
content_type = data_file.content_type if data_file.content_type in allowed_types else\
    mimetypes.guess_type(data_file.name)[0]
if content_type in allowed_types:
    ...
```

we're still repeating the `data_file.content_type in` check if it's true the first time, maybe there's an even cleaner way... but this seems OK.