Skip to content

Commit

Permalink
fix: prune away unsused model and view (#7585)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjsparks committed Jun 24, 2024
1 parent 77f61f0 commit 5aacd59
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 58 deletions.
16 changes: 16 additions & 0 deletions ietf/iesg/migrations/0003_delete_telechat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 4.2.13 on 2024-06-21 20:40

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("iesg", "0002_telechatagendacontent"),
]

operations = [
migrations.DeleteModel(
name="Telechat",
),
]
14 changes: 0 additions & 14 deletions ietf/iesg/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,6 @@ def __str__(self):
type_name = self.TYPE_CHOICES_DICT.get(self.type, str(self.type))
return "%s: %s" % (type_name, self.title or "")

class Telechat(models.Model):
telechat_id = models.IntegerField(primary_key=True)
telechat_date = models.DateField(null=True, blank=True)
minute_approved = models.IntegerField(null=True, blank=True)
wg_news_txt = models.TextField(blank=True)
iab_news_txt = models.TextField(blank=True)
management_issue = models.TextField(blank=True)
frozen = models.IntegerField(null=True, blank=True)
mi_frozen = models.IntegerField(null=True, blank=True)

class Meta:
db_table = 'telechat'


def next_telechat_date():
dates = TelechatDate.objects.order_by("-date")
if dates:
Expand Down
55 changes: 25 additions & 30 deletions ietf/iesg/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,70 +9,65 @@

from ietf import api

from ietf.iesg.models import TelechatDate, Telechat, TelechatAgendaItem, TelechatAgendaContent
from ietf.iesg.models import TelechatDate, TelechatAgendaItem, TelechatAgendaContent


class TelechatDateResource(ModelResource):
class Meta:
cache = SimpleCache()
queryset = TelechatDate.objects.all()
serializer = api.Serializer()
#resource_name = 'telechatdate'
ordering = ['id', ]
filtering = {
# resource_name = 'telechatdate'
ordering = [
"id",
]
filtering = {
"id": ALL,
"date": ALL,
}


api.iesg.register(TelechatDateResource())

class TelechatResource(ModelResource):
class Meta:
cache = SimpleCache()
queryset = Telechat.objects.all()
serializer = api.Serializer()
#resource_name = 'telechat'
ordering = ['tlechat_id', ]
filtering = {
"telechat_id": ALL,
"telechat_date": ALL,
"minute_approved": ALL,
"wg_news_txt": ALL,
"iab_news_txt": ALL,
"management_issue": ALL,
"frozen": ALL,
"mi_frozen": ALL,
}
api.iesg.register(TelechatResource())

class TelechatAgendaItemResource(ModelResource):
class Meta:
cache = SimpleCache()
queryset = TelechatAgendaItem.objects.all()
serializer = api.Serializer()
#resource_name = 'telechatagendaitem'
ordering = ['id', ]
filtering = {
# resource_name = 'telechatagendaitem'
ordering = [
"id",
]
filtering = {
"id": ALL,
"text": ALL,
"type": ALL,
"title": ALL,
}
api.iesg.register(TelechatAgendaItemResource())


api.iesg.register(TelechatAgendaItemResource())

from ietf.name.resources import TelechatAgendaSectionNameResource


class TelechatAgendaContentResource(ModelResource):
section = ToOneField(TelechatAgendaSectionNameResource, 'section')
section = ToOneField(TelechatAgendaSectionNameResource, "section")

class Meta:
queryset = TelechatAgendaContent.objects.none()
serializer = api.Serializer()
cache = SimpleCache()
#resource_name = 'telechatagendacontent'
ordering = ['id', ]
filtering = {
# resource_name = 'telechatagendacontent'
ordering = [
"id",
]
filtering = {
"id": ALL,
"text": ALL,
"section": ALL_WITH_RELATIONS,
}


api.iesg.register(TelechatAgendaContentResource())
1 change: 0 additions & 1 deletion ietf/secr/telechat/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@
url(r'^(?P<date>[0-9\-]+)/management/$', views.management),
url(r'^(?P<date>[0-9\-]+)/minutes/$', views.minutes),
url(r'^(?P<date>[0-9\-]+)/roll-call/$', views.roll_call),
url(r'^new/$', views.new),
]
14 changes: 1 addition & 13 deletions ietf/secr/telechat/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from ietf.person.models import Person
from ietf.doc.lastcall import request_last_call
from ietf.doc.mails import email_state_changed
from ietf.iesg.models import TelechatDate, TelechatAgendaItem, Telechat
from ietf.iesg.models import TelechatDate, TelechatAgendaItem
from ietf.iesg.agenda import agenda_data, get_doc_section
from ietf.ietfauth.utils import role_required
from ietf.secr.telechat.forms import BallotForm, ChangeStateForm, DateSelectForm, TELECHAT_TAGS
Expand Down Expand Up @@ -419,18 +419,6 @@ def minutes(request, date):
'da_docs': da_docs},
)

@role_required('Secretariat')
def new(request):
'''
This view creates a new telechat agenda and redirects to the default view
'''
if request.method == 'POST':
date = request.POST['date']
# create legacy telechat record
Telechat.objects.create(telechat_date=date)

messages.success(request,'New Telechat Agenda created')
return redirect('ietf.secr.telechat.views.doc', date=date)

@role_required('Secretariat')
def roll_call(request, date):
Expand Down

0 comments on commit 5aacd59

Please sign in to comment.