mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 13:17:50 +02:00
Fix a bug related to consist
This commit is contained in:
@@ -105,6 +105,7 @@ class ConsistItem(models.Model):
|
|||||||
# it is hosted here to avoid circular imports
|
# it is hosted here to avoid circular imports
|
||||||
@receiver(models.signals.post_save, sender=RollingStock)
|
@receiver(models.signals.post_save, sender=RollingStock)
|
||||||
def post_save_unpublish_consist(sender, instance, *args, **kwargs):
|
def post_save_unpublish_consist(sender, instance, *args, **kwargs):
|
||||||
|
if not instance.published:
|
||||||
consists = Consist.objects.filter(consist_item__rolling_stock=instance)
|
consists = Consist.objects.filter(consist_item__rolling_stock=instance)
|
||||||
for consist in consists:
|
for consist in consists:
|
||||||
consist.published = False
|
consist.published = False
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
from ram.utils import git_suffix
|
from ram.utils import git_suffix
|
||||||
|
|
||||||
__version__ = "0.16.5"
|
__version__ = "0.16.6"
|
||||||
__version__ += git_suffix(__file__)
|
__version__ += git_suffix(__file__)
|
||||||
|
Reference in New Issue
Block a user