def clean_media(self):
        data_type = self.cleaned_data['media'].content_type
        if data_type not in ['image/jpeg', 'image/png', 'audio/mpeg']:
            raise forms.ValidationError('Only these media types are \
                                        allowed .png .jpg .mp3 .3gp .wav')
dataset/ETHPy150Open kobotoolbox/kobocat/onadata/apps/main/forms.py/MediaForm.clean_media/original