store timestamp on position update
This commit is contained in:
parent
e93cd6b08a
commit
3c9fd6fb60
1 changed files with 5 additions and 0 deletions
|
@ -3,6 +3,7 @@ from collections import OrderedDict
|
|||
from django.conf import settings
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.forms import CharField, ModelForm
|
||||
from django.utils import timezone
|
||||
from django.utils.text import capfirst, format_lazy
|
||||
from django.utils.translation import get_language_info
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
@ -77,6 +78,10 @@ class PositionAPIUpdateForm(ModelForm):
|
|||
model = Position
|
||||
fields = ['coordinates_id', 'timeout']
|
||||
|
||||
def save(self, commit=True):
|
||||
self.instance.last_coordinates_update = timezone.now()
|
||||
super().save(commit)
|
||||
|
||||
def clean_secret(self):
|
||||
# not called api_secret so we don't overwrite it
|
||||
api_secret = self.cleaned_data['secret']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue