Commit f2893fb3 authored by Ilya Simonov's avatar Ilya Simonov

fix signal for update playlist mrss and json

parent 58b3caa9
......@@ -6,7 +6,8 @@ from . import models
@receiver(post_save, sender=models.Playlist)
def save_playlist_links(sender, instance, created, **kwargs):
instance.json = f'{settings.DOMAIN_NAME}/api/playlist/{instance.id}/'
instance.mrss = f'{settings.DOMAIN_NAME}/api/playlist/{instance.id}/mrss'
instance.save()
def post_save_playlist(sender, instance, created, **kwargs):
if not instance.json or not instance.mrss:
instance.json = f'{settings.DOMAIN_NAME}/api/playlist/{instance.id}/'
instance.mrss = f'{settings.DOMAIN_NAME}/api/playlist/{instance.id}/mrss'
instance.save()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment