You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
431 B
12 lines
431 B
from django.core.signals import request_finished
|
|
from django.db.models.signals import post_save
|
|
from django.utils import timezone
|
|
from django.dispatch import receiver
|
|
from .models import Stage
|
|
|
|
|
|
@receiver(post_save, sender=Stage)
|
|
def set_approve_time(sender, instance, created, **kwargs):
|
|
if instance.status == 'in_process' and not instance.approve_time:
|
|
instance.approve_time = timezone.now()
|
|
instance.save()
|
|
|