Skip to content

Commit a3c8adf

Browse files
committed
Merged in the contents of commit [6337] from mcr@sandelman.ca, with some changes to take out dead code that inadvertently came back in.
- Legacy-Id: 6344 Note: SVN reference [6337] has been migrated to Git commit d0d1d94
1 parent 08e90fd commit a3c8adf

50 files changed

Lines changed: 3323 additions & 621 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

changelog

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,51 @@
1+
ietfdb (4.80) ietf; urgench=high
2+
3+
This is a major release which provides the code drop from phase 3 of the
4+
Agenda Scheduling Tool. The code has been merged in, and a lot of minor
5+
alignments done. Deployment of this will make the phase 3 agenda editing
6+
tools available from the main ietf site, will align the database schema with
7+
that used in the ongoing development work, and will provide the correct
8+
models for secretariat tool adaptations.
9+
10+
* Reworked the TestCase code and fixture loading substantially, resulting
11+
in a substantial speed increase for tests when run on a transaction-
12+
capable database engine.
13+
14+
* Added an index page for nomcoms, at /nomcom/, with links to nomcom
15+
pages and announcements, where they exist.
16+
17+
* Fixed some bugs in the EncryptedTextField class.
18+
19+
* Fixed the language of the nomination confirmation message.
20+
21+
* Changed 'requirement' to 'desired expertise' in user-visible places in
22+
the nomcom app.
23+
24+
* Fixed a wrong secretariat template extension name.
25+
26+
* Provide the missing safe_rep function required in the back-ported
27+
assertIsNone() test case method.
28+
29+
* Added an explanatory paragraph to the Desired Expertise page.
30+
31+
* The exception string for submission upload read errors seems to have
32+
changed after we switched to wsgi, from "Client read error" to "request
33+
data read error". Now looking for just "read error".
34+
35+
* Tweaked the introductory text on the Desired Expertise page.
36+
37+
* Added a makefixture management command, from
38+
http://djangosnippets.org/snippets/918/, somewhat hacked.
39+
40+
* Updated fixtures, built to be more internally consistent in order to be
41+
able to pre-load them for the test suite.
42+
43+
* Fixed the manyfold duplicated position names in the position selection
44+
drop-down list in the nomcom private index page. Fixes issue #1137.
45+
46+
-- Henrik Levkowetz <henrik@netnod.se> 01 Oct 2013 16:54:16 +0200
47+
48+
149
ietfdb (4.72) ietf; urgency=medium
250

351
* Added a migration for a new ConstraintName field: penalty

ietf/group/models.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import datetime
1313
import debug
14-
14+
1515
class GroupInfo(models.Model):
1616
time = models.DateTimeField(default=datetime.datetime.now)
1717
name = models.CharField(max_length=80)
@@ -101,10 +101,14 @@ def json_dict(self, host_scheme):
101101
group1['name'] = self.name
102102
group1['state'] = self.state.slug
103103
group1['type'] = self.type.slug
104-
group1['parent_href'] = urljoin(host_scheme, self.parent.json_url())
104+
if self.parent is not None:
105+
group1['parent_href'] = urljoin(host_scheme, self.parent.json_url())
105106
# uncomment when people URL handle is created
106-
#if self.ad is not None:
107-
# group1['ad_href'] = urljoin(host_scheme, self.ad.url())
107+
try:
108+
if self.ad is not None:
109+
group1['ad_href'] = urljoin(host_scheme, self.ad.json_url())
110+
except Person.DoesNotExist:
111+
pass
108112
group1['list_email'] = self.list_email
109113
group1['list_subscribe'] = self.list_subscribe
110114
group1['list_archive'] = self.list_archive

ietf/meeting/ajax.py

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@
2828

2929
log = logging.getLogger(__name__)
3030

31+
import debug
32+
3133
@dajaxice_register
3234
def readonly(request, meeting_num, schedule_id):
35+
debug.say('readonly()')
36+
debug.show('meeting_num')
37+
debug.show('schedule_id')
3338
meeting = get_meeting(meeting_num)
3439
schedule = get_schedule_by_id(meeting, schedule_id)
3540

@@ -61,6 +66,30 @@ def readonly(request, meeting_num, schedule_id):
6166
'owner_href': request.build_absolute_uri(schedule.owner.json_url()),
6267
'read_only': read_only})
6368

69+
@group_required('Area Director','Secretariat')
70+
@dajaxice_register
71+
def update_timeslot_pinned(request, schedule_id, scheduledsession_id, pinned=False):
72+
schedule = get_object_or_404(Schedule, pk = int(schedule_id))
73+
meeting = schedule.meeting
74+
cansee,canedit = agenda_permissions(meeting, schedule, request.user)
75+
76+
if not canedit:
77+
raise Http403
78+
return json.dumps({'error':'no permission'})
79+
80+
if scheduledsession_id is not None:
81+
ss_id = int(scheduledsession_id)
82+
83+
if ss_id != 0:
84+
ss = get_object_or_404(schedule.scheduledsession_set, pk=ss_id)
85+
86+
ss.pinned = pinned
87+
ss.save()
88+
89+
return json.dumps({'message':'valid'})
90+
91+
92+
6493
@group_required('Area Director','Secretariat')
6594
@dajaxice_register
6695
def update_timeslot(request, schedule_id, session_id, scheduledsession_id=None, extended_from_id=None, duplicate=False):
@@ -458,14 +487,36 @@ def session_json(request, num, sessionid):
458487
try:
459488
session = meeting.session_set.get(pk=int(sessionid))
460489
except Session.DoesNotExist:
461-
return json.dumps({'error':"no such session %s" % sessionid})
490+
# return json.dumps({'error':"no such session %s" % sessionid})
491+
return HttpResponse(json.dumps({'error':"no such session %s" % sessionid}),
492+
status = 404,
493+
mimetype="application/json")
462494

463495
sess1 = session.json_dict(request.build_absolute_uri('/'))
464496
return HttpResponse(json.dumps(sess1, sort_keys=True, indent=2),
465497
mimetype="application/json")
466498

467499
# Would like to cache for 1 day, but there are invalidation issues.
468500
#@cache_page(86400)
501+
def constraint_json(request, num, constraintid):
502+
meeting = get_meeting(num)
503+
504+
try:
505+
constraint = meeting.constraint_set.get(pk=int(constraintid))
506+
except Constraint.DoesNotExist:
507+
return HttpResponse(json.dumps({'error':"no such constraint %s" % constraintid}),
508+
status = 404,
509+
mimetype="application/json")
510+
511+
json1 = constraint.json_dict(request.get_host_protocol())
512+
return HttpResponse(json.dumps(json1, sort_keys=True, indent=2),
513+
mimetype="application/json")
514+
515+
516+
# Cache for 2 hour2
517+
#@cache_page(7200)
518+
# caching is a problem if there Host: header changes.
519+
#
469520
def session_constraints(request, num, sessionid):
470521
meeting = get_meeting(num)
471522

ietf/meeting/fixtures/constraint83.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,5 +1454,9 @@
14541454
{"pk": 22491, "model": "meeting.constraint", "fields": {"source": 1847, "meeting": 83, "target": 1751, "name": "conflic2"}},
14551455
{"pk": 22492, "model": "meeting.constraint", "fields": {"source": 1847, "meeting": 83, "target": 1817, "name": "conflic2"}},
14561456
{"pk": 22493, "model": "meeting.constraint", "fields": {"source": 1847, "meeting": 83, "target": 1728, "name": "conflic2"}},
1457-
{"pk": 22494, "model": "meeting.constraint", "fields": {"source": 1847, "meeting": 83, "target": 1789, "name": "conflic2"}}
1458-
]
1457+
{"pk": 22494, "model": "meeting.constraint", "fields": {"source": 1847, "meeting": 83, "target": 1789, "name": "conflic2"}},
1458+
{"pk": 23000, "model": "meeting.constraint", "fields": {"source": 1816, "meeting": 83, "name": "bethere", "person": 103539}},
1459+
{"pk": 23001, "model": "meeting.constraint", "fields": {"source": 1816, "meeting": 83, "name": "bethere", "person": 108554}},
1460+
{"pk": 23002, "model": "meeting.constraint", "fields": {"source": 1816, "meeting": 83, "name": "bethere", "person": 102830}}
1461+
1462+
]

ietf/meeting/helpers.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010

1111
from django import forms
1212
from django.http import Http404
13+
from django.http import HttpRequest
1314
from django.db.models import Max, Q
1415
from django.conf import settings
16+
from django.core.cache import cache
17+
from django.utils.cache import get_cache_key
1518

1619
import debug
1720
import urllib
@@ -344,3 +347,15 @@ def agenda_permissions(meeting, schedule, user):
344347
canedit = True
345348

346349
return cansee,canedit
350+
351+
def session_constraint_expire(session):
352+
from django.core.urlresolvers import reverse
353+
from ajax import session_constraints
354+
path = reverse(session_constraints, args=[session.meeting.number, session.pk])
355+
request = HttpRequest()
356+
request.path = path
357+
key = get_cache_key(request)
358+
if key is not None and cache.has_key(key):
359+
cache.delete(key)
360+
361+

0 commit comments

Comments
 (0)