code: def __allowed_extension(self, filename, extensions):
          
          allowed_extensions = current_app.config['UPLOADS']['EXTENSIONS']
          if extensions is not None:
              allowed_extensions = extensions
          return '.' in filename and filename.rsplit('.', 1)[1].lower() in \
              allowed_extensions
docs: Check allowed file extensions