def clean(self): if not self.tags: self.tags = {} elif not isinstance(self.tags, dict): raise me.ValidationError('Tags must be a dictionary')