Skip to content

Commit 22e2a6a

Browse files
committed
Delete the DocumentChangeDates model from CommunityList, it's being
used as a cache, but won't be necessary once the display code is rewritten since it will be able to calculate the data on the fly - Legacy-Id: 10682
1 parent 1b8e9eb commit 22e2a6a

4 files changed

Lines changed: 3 additions & 72 deletions

File tree

ietf/community/display.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,22 +182,22 @@ class PublicationSort(SortMethod):
182182
description = 'Date of publication of current version of the document'
183183

184184
def get_sort_field(self):
185-
return '-documentchangedates__new_version_date'
185+
return '-time' # FIXME: latest revision date
186186

187187
class ChangeSort(SortMethod):
188188
codename = 'recent_change'
189189
description = 'Date of most recent change of status of any type'
190190

191191
def get_sort_field(self):
192-
return '-documentchangedates__normal_change_date'
192+
return '-time' # FIXME: latest doc event
193193

194194

195195
class SignificantSort(SortMethod):
196196
codename = 'recent_significant'
197197
description = 'Date of most recent significant change of status'
198198

199199
def get_sort_field(self):
200-
return '-documentchangedates__significant_change_date'
200+
return '-time' # FIXME: latest significant state change
201201

202202

203203
TYPES_OF_SORT = [(i.codename, i.description) for i in SortMethod.__subclasses__()]

ietf/community/management/commands/update_doc_change_dates.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

ietf/community/models.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -203,29 +203,15 @@ def notify_events(sender, instance, **kwargs):
203203
return
204204
if instance.doc.type.slug != 'draft' or instance.type == 'added_comment':
205205
return
206-
(changes, created) = DocumentChangeDates.objects.get_or_create(document=instance.doc)
207-
changes.normal_change_date = instance.time
208206
significant = False
209207
if instance.type == 'changed_document' and 'tate changed' in instance.desc:
210208
for i in SIGNIFICANT_STATES:
211209
if ('<b>%s</b>' % i) in instance.desc:
212210
significant = True
213-
changes.significant_change_date = instance.time
214211
break
215-
elif instance.type == 'new_revision':
216-
changes.new_version_date = instance.time
217-
changes.save()
218212
notification = ListNotification.objects.create(
219213
event=instance,
220214
significant=significant,
221215
)
222216
notification.notify_by_email()
223217
signals.post_save.connect(notify_events)
224-
225-
226-
class DocumentChangeDates(models.Model):
227-
228-
document = models.ForeignKey(Document)
229-
new_version_date = models.DateTimeField(blank=True, null=True)
230-
normal_change_date = models.DateTimeField(blank=True, null=True)
231-
significant_change_date = models.DateTimeField(blank=True, null=True)

ietf/community/resources.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,3 @@ class Meta:
8888
"community_list": ALL_WITH_RELATIONS,
8989
}
9090
api.community.register(EmailSubscriptionResource())
91-
92-
from ietf.doc.resources import DocumentResource
93-
class DocumentChangeDatesResource(ModelResource):
94-
document = ToOneField(DocumentResource, 'document')
95-
class Meta:
96-
queryset = DocumentChangeDates.objects.all()
97-
serializer = api.Serializer()
98-
#resource_name = 'documentchangedates'
99-
filtering = {
100-
"id": ALL,
101-
"new_version_date": ALL,
102-
"normal_change_date": ALL,
103-
"significant_change_date": ALL,
104-
"document": ALL_WITH_RELATIONS,
105-
}
106-
api.community.register(DocumentChangeDatesResource())
107-

0 commit comments

Comments
 (0)