Skip to content

Commit

Permalink
update the last_changed_time when an observation end is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon committed Sep 6, 2019
1 parent 8c57a74 commit c06110a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions observation_portal/observations/serializers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from rest_framework import serializers
from django.utils import timezone
from django.core.cache import cache
from django.utils.translation import ugettext as _

from observation_portal.common.configdb import configdb
Expand Down Expand Up @@ -358,6 +359,7 @@ def update(self, instance, validated_data):
num_canceled = Observation.cancel(observations)
logger.info(
"updated end time for observation {instance.id} to {instance.end}. Canceled {num_canceled} overlapping observations.")
cache.set('observation_portal_last_change_time', timezone.now(), None)

return instance

Expand Down

0 comments on commit c06110a

Please sign in to comment.