Skip to content

Commit 3c72710

Browse files
committed
Merged in [13717] from rjsparks@nostrum.com:
Actually use the topic audience type in the feedback view. Fixes ietf-tools#2320. - Legacy-Id: 13728 Note: SVN reference [13717] has been migrated to Git commit 9638cb2
1 parent 22f181c commit 3c72710

3 files changed

Lines changed: 104 additions & 0 deletions

File tree

changelog

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,67 @@
1+
ietfdb (6.55.2) ietf; urgency=medium
2+
3+
This release contains bugfixes and code refactoring:
4+
5+
* Modified the text shown on Chairs' 'Manage Document Adoption in Group'
6+
button and corrected the logic for which text to show.
7+
8+
* Merged in [13722] and [13712] from rcross@amsl.com:
9+
Remove all use of request.session from secretariat apps. Add tests for
10+
affected views. Fixes #1455.
11+
12+
* Removed the copy of xym copied directly from repository -- the method
13+
call we use is too unstable at the moment. Now requiring xym=='0.4'.
14+
15+
* Merged in [13628] from rcross@amsl.com:
16+
Grant secretariat meeting__meeting admin permissions.
17+
18+
* Added checks for the presence of yang module directories to the check
19+
framework. Tweaked some text strings.
20+
21+
* Modified the yang checker to work with both versions 0.3.x and 0.4.x of
22+
xym (different signatures for get_extracted_models()).
23+
24+
* Removed the 'apply to all sessions' checkbox from the
25+
agenda/minutes/slides upload pages for non-session timeslots, such as
26+
plenaries etc. as it is rarely if ever correct to have it checked then.
27+
28+
* Additional tweaks to the mailman listinfo importer.
29+
30+
* Code reorganization, doing away with multiple urls_* and views_ files
31+
in ietf.group. No intentional functionality changes.
32+
33+
* Made the import_mailman_listinfo management command somewhat more
34+
robust.
35+
36+
* Return a checker None result with exception message on xym exceptions.
37+
38+
* Changed the url coverage code to handle deeper chains of url includes,
39+
and to handle url includes through url lists in addition to url modules.
40+
Added information in the release coverage dictionaries about the view
41+
functions coupled to the urls.
42+
43+
* Fixed a wrong virtualenv path in bin/mm_hourly
44+
45+
* Updated PLAN
46+
47+
* Updated docker/settings_local.py with new needed settings. Added a lot
48+
of quotes to docker/run in order to work better with paths containsing
49+
spaces. Touched a file during setup to be more debian compatible.
50+
51+
* Variable naming tweak
52+
53+
* Catch bad module names in the Yang checker (they are not currently
54+
flagged by xym).
55+
56+
* Changed the implementation of Submission.latest_checks() to also return
57+
None checks, so it's possible to update a Passed due to no yang modules to
58+
a None (no modules to check).
59+
60+
* Corrected the settings names used in the yang extraction command.
61+
62+
-- Henrik Levkowetz <henrik@levkowetz.com> 28 Jun 2017 10:43:38 -0700
63+
64+
165
ietfdb (6.55.1) ietf; urgency=medium
266

367
This is a bugfix release, with some smaller enhancements. From the commit

ietf/nomcom/tests.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,3 +1992,33 @@ def testTopicFeedback(self):
19921992
self.assertContains(response, "alert-success")
19931993
self.assertNotContains(response, "feedbackform")
19941994
self.assertEqual(topic.feedback_set.count(),1)
1995+
1996+
def testAudience(self):
1997+
for audience in ['nomcom','nominee']:
1998+
topic = TopicFactory(nomcom=self.nc,audience_id=audience)
1999+
feedback_url = reverse('ietf.nomcom.views.public_feedback',kwargs={'year':self.nc.year() })
2000+
login_testing_unauthorized(self, self.plain_person.user.username, feedback_url)
2001+
r = self.client.get(feedback_url)
2002+
self.assertEqual(r.status_code,200)
2003+
self.assertFalse(topic.subject in unicontent(r))
2004+
topic_url = feedback_url + '?topic=%d'%topic.pk
2005+
r = self.client.get(topic_url)
2006+
self.assertEqual(r.status_code,404)
2007+
r = self.client.post(topic_url, {'comments':'junk', 'confirmation':False})
2008+
self.assertEqual(r.status_code,404)
2009+
2010+
self.client.logout()
2011+
if audience == 'nomcom':
2012+
valid_user = self.nc.group.role_set.filter(name='member').first().person
2013+
else:
2014+
valid_user = self.nc.nominee_set.first().person
2015+
self.client.login(username=valid_user.user.username,password=valid_user.user.username+"+password")
2016+
r = self.client.get(feedback_url)
2017+
self.assertEqual(r.status_code,200)
2018+
self.assertTrue(topic.subject in unicontent(r))
2019+
r = self.client.get(topic_url)
2020+
self.assertEqual(r.status_code,200)
2021+
r = self.client.post(topic_url, {'comments':'junk', 'confirmation':False})
2022+
self.assertEqual(r.status_code,200)
2023+
self.assertEqual(topic.feedback_set.count(),1)
2024+
self.client.logout()

ietf/nomcom/views.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,10 @@ def feedback(request, year, public):
426426
selected_topic = request.GET.get('topic')
427427
if selected_topic:
428428
topic = get_object_or_404(Topic,id=selected_topic)
429+
if topic.audience_id == 'nomcom' and not nomcom.group.has_role(request.user, ['chair','advisor','liaison','member']):
430+
raise Http404()
431+
if topic.audience_id == 'nominee' and not nomcom.nominee_set.filter(person=request.user.person).exists():
432+
raise Http404()
429433

430434
if public:
431435
positions = Position.objects.get_by_nomcom(nomcom=nomcom).filter(is_open=True,accepting_feedback=True)
@@ -434,6 +438,12 @@ def feedback(request, year, public):
434438
positions = Position.objects.get_by_nomcom(nomcom=nomcom).filter(is_open=True)
435439
topics = Topic.objects.filter(nomcom=nomcom)
436440

441+
if not nomcom.group.has_role(request.user, ['chair','advisor','liaison','member']):
442+
topics = topics.exclude(audience_id='nomcom')
443+
if not nomcom.nominee_set.filter(person=request.user.person).exists():
444+
topics = topics.exclude(audience_id='nominee')
445+
446+
437447
user_comments = Feedback.objects.filter(nomcom=nomcom,
438448
type='comment',
439449
author__in=request.user.person.email_set.filter(active='True'))

0 commit comments

Comments
 (0)