Skip to content

Commit 24c320f

Browse files
committed
Restrict all found IPRs to status 1 and 3. Only show links to, and display details of, IPRs with status 1.
- Legacy-Id: 720
1 parent 261b8d2 commit 24c320f

5 files changed

Lines changed: 9 additions & 3 deletions

File tree

ietf/ipr/feeds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class LatestIprDisclosures(Feed):
1313
feed_url = "/feeds/ipr/"
1414

1515
def items(self):
16-
return IprDetail.objects.order_by('-submitted_date')[:5]
16+
return IprDetail.objects.filter(status__in=[1,3]).order_by('-submitted_date')[:5]
1717

1818
def item_link(self, item):
1919
return "/ipr/ipr-%s" % item.ipr_id

ietf/ipr/new.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from datetime import datetime
99
from django.shortcuts import render_to_response as render
1010
from django.template import RequestContext
11+
from django.http import Http404
1112
from ietf.utils import log
1213
from ietf.utils.mail import send_mail
1314
from ietf.ipr.view_sections import section_table
@@ -337,6 +338,8 @@ def __init__(self, *args, **kwargs):
337338
submitter = form.clean_data
338339

339340
ipr = models.IprDetail.objects.get(ipr_id=ipr_id)
341+
if not ipr.status in [1,3]:
342+
raise Http404
340343
type = "specific"
341344
if ipr.generic:
342345
type = "generic"

ietf/ipr/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
(r'^search/$', search.search),
1414
)
1515

16-
queryset = models.IprDetail.objects.all()
16+
queryset = models.IprDetail.objects.filter(status__in=[1,3])
1717
archive = {'queryset':queryset, 'date_field': 'submitted_date', 'allow_empty':True }
1818

1919
urlpatterns += patterns('django.views.generic.date_based',

ietf/ipr/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from django.shortcuts import render_to_response as render
55
from django.template import RequestContext
66
from django.utils.html import escape
7+
from django.http import Http404
78
from ietf.idtracker.models import IETFWG
89
from ietf.ipr.models import IprDetail, SELECT_CHOICES, LICENSE_CHOICES
910
from ietf.ipr.view_sections import section_table
@@ -47,6 +48,8 @@ def show(request, ipr_id=None):
4748
"""Show a specific IPR disclosure"""
4849
assert ipr_id != None
4950
ipr = IprDetail.objects.get(ipr_id=ipr_id)
51+
if not ipr.status == 1:
52+
raise Http404
5053
section_list = get_section_list(ipr)
5154
contacts = ipr.contact.all()
5255
for contact in contacts:

ietf/templates/ipr/details.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ <h3>{{ ipr.title }}</h3>
6262
<font size="3">
6363
<br>
6464
This IPR disclosure updates IPR disclosure ID #{{ item.updated.ipr_id }},
65-
{% ifequal item.status_to_be 1 %}
65+
{% ifequal item.status 1 %}
6666
"<a href="{% url ietf.ipr.views.show item.updated.ipr_id %}">{{ item.updated.title }}</a>".
6767
{% else %}
6868
"{{ item.updated.title }}", which was removed at the request of the submitter.

0 commit comments

Comments
 (0)