summaryrefslogtreecommitdiff
path: root/releng
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@kiwwwi.com.ar>2011-08-03 16:05:35 -0300
committerNicolás Reynolds <fauno@kiwwwi.com.ar>2011-08-03 16:05:35 -0300
commitfbd23db51b7160a308cd88e407e676994eb08b10 (patch)
treee3816cc4e3f0ee07539fb4464b2d886a43ecc318 /releng
parenta8b2fc84ba96c83ec1addf89ac04608fbf572705 (diff)
parent0f6c80e9a36bc5770e95543b4374c5ace4383cf5 (diff)
Merge branch 'master' of git://projects.archlinux.org/archweb
Conflicts: packages/urls.py templates/packages/details.html
Diffstat (limited to 'releng')
-rw-r--r--releng/models.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/releng/models.py b/releng/models.py
index 07ede1c5..5510db6a 100644
--- a/releng/models.py
+++ b/releng/models.py
@@ -1,6 +1,7 @@
-from datetime import datetime
-
from django.db import models
+from django.db.models.signals import pre_save
+
+from main.utils import set_created_field
class IsoOption(models.Model):
name = models.CharField(max_length=200)
@@ -104,14 +105,6 @@ class Test(models.Model):
success = models.BooleanField()
comments = models.TextField(null=True, blank=True)
-def set_created_field(sender, **kwargs):
- # We use this same callback for both Isos and Tests
- obj = kwargs['instance']
- if not obj.created:
- obj.created = datetime.utcnow()
-
-from django.db.models.signals import pre_save
-
pre_save.connect(set_created_field, sender=Iso,
dispatch_uid="releng.models")
pre_save.connect(set_created_field, sender=Test,