Skip to content

Commit

Permalink
zilencer: Add auto_now to RemoteZulipServer.last_updated.
Browse files Browse the repository at this point in the history
This should simplify the logic needed to create one of these.
  • Loading branch information
timabbott committed May 16, 2017
1 parent 07ecf97 commit c7d2caa
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-16 00:03
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('zilencer', '0002_remote_zulip_server'),
]

operations = [
migrations.AlterField(
model_name='remotezulipserver',
name='last_updated',
field=models.DateTimeField(auto_now=True, verbose_name='last updated'),
),
]
2 changes: 1 addition & 1 deletion zilencer/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class RemoteZulipServer(models.Model):

hostname = models.CharField(max_length=128, unique=True) # type: Text
contact_email = models.EmailField(blank=True, null=False) # type: Text
last_updated = models.DateTimeField('last updated') # type: datetime.datetime
last_updated = models.DateTimeField('last updated', auto_now=True) # type: datetime.datetime

# Variant of PushDeviceToken for a remote server.
class RemotePushDeviceToken(zerver.models.AbstractPushDeviceToken):
Expand Down

0 comments on commit c7d2caa

Please sign in to comment.