def clean(self): try: parsed_lyrics = parse_lyrics(self.lyrics) transpose_lyrics(parsed_lyrics, 0) except SyntaxError as m: raise ValidationError('Niepoprawny format treści piosenki: ' + str(m)) return super().clean()
def save(self, *args, **kwargs): self.has_extra_chords = contain_extra_chords(parse_lyrics(self.lyrics)) super().save(*args, **kwargs)
def clean(self): try: parsed_lyrics = parse_lyrics(self.lyrics) transpose_lyrics(parsed_lyrics, 0) except SyntaxError as m: raise ValidationError('Lyrics syntax is incorrect: ' + str(m))