Beispiel #1
0
 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()
Beispiel #2
0
 def save(self, *args, **kwargs):
     self.has_extra_chords = contain_extra_chords(parse_lyrics(self.lyrics))
     super().save(*args, **kwargs)
Beispiel #3
0
 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))