summaryrefslogtreecommitdiff
path: root/packages/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/models.py')
-rw-r--r--packages/models.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/packages/models.py b/packages/models.py
index a950bddb..0983c642 100644
--- a/packages/models.py
+++ b/packages/models.py
@@ -1,9 +1,9 @@
-from datetime import datetime
-
from django.db import models
from django.db.models.signals import pre_save, post_save
from django.contrib.auth.models import User
+from main.utils import set_created_field
+
class PackageRelation(models.Model):
'''
Represents maintainership (or interest) in a package by a given developer.
@@ -112,12 +112,6 @@ def remove_inactive_maintainers(sender, instance, created, **kwargs):
type=PackageRelation.MAINTAINER)
maint_relations.delete()
-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()
-
post_save.connect(remove_inactive_maintainers, sender=User,
dispatch_uid="packages.models")
pre_save.connect(set_created_field, sender=PackageRelation,