summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2012-10-08 13:52:40 +0200
committerLeif Johansson <leifj@sunet.se>2012-10-08 13:52:40 +0200
commitbd8cf29f8c2f0c8298e7bf324f865bd7aab722b3 (patch)
tree32f0bf109a8afa3d26e95a5a6c1095c359c722ff
parent75a8540989bae973093f0589b32274264f9cad2e (diff)
- download-link
- don't catch exception - unlock in finally
-rw-r--r--meetingtools/apps/cluster/models.py9
-rw-r--r--meetingtools/apps/room/views.py10
2 files changed, 12 insertions, 7 deletions
diff --git a/meetingtools/apps/cluster/models.py b/meetingtools/apps/cluster/models.py
index 3c65d57..592b384 100644
--- a/meetingtools/apps/cluster/models.py
+++ b/meetingtools/apps/cluster/models.py
@@ -16,13 +16,16 @@ class ACCluster(models.Model):
name = CharField(max_length=128,blank=True,unique=True)
default_template_sco_id = IntegerField(blank=True,unique=True)
domain_match = TextField()
-
+
def __unicode__(self):
return self.url
-
+
def make_url(self,path=""):
return "%s%s" % (self.url,path)
-
+
+ def make_dl_url(self,path=""):
+ return "%s%s/output/%s.zip?download=zip" % (self,path.strip("/"),path.strip("/"))
+
def acc_for_user(user):
(local,domain) = user.username.split('@')
if not domain:
diff --git a/meetingtools/apps/room/views.py b/meetingtools/apps/room/views.py
index c46ab6e..aa10cf6 100644
--- a/meetingtools/apps/room/views.py
+++ b/meetingtools/apps/room/views.py
@@ -152,7 +152,9 @@ def _update_room(request, room, form=None):
user_principal = api.find_user(room.creator.username)
#api.request('permissions-reset',{'acl-id': sco_id},True)
- api.request('permissions-update',{'acl-id': sco_id,'principal-id': user_principal.get('principal-id'),'permission-id':'host'},True) # owner is always host
+ api.request('permissions-update',{'acl-id': sco_id,
+ 'principal-id': user_principal.get('principal-id'),
+ 'permission-id':'host'},True) # owner is always host
if form:
if form.cleaned_data.has_key('access'):
@@ -409,10 +411,8 @@ def _goto(request,room,clean=True,promote=False):
room.lock("Locked for cleaning")
try:
room = _clean(request,room)
- except Exception,e:
+ finally:
room.unlock()
- raise e
- room.unlock()
if room.host_count == 0 and room.allow_host:
return respond_to(request, {"text/html": "apps/room/launch.html"}, {'room': room})
@@ -496,6 +496,7 @@ def _can_tag(request,tag):
# XXX implement access model for tags here soon
return True,""
+@never_cache
@login_required
def untag(request,rid,tag):
room = get_object_or_404(Room,pk=rid)
@@ -536,6 +537,7 @@ def room_recordings(request,room):
return [{'name': sco.findtext('name'),
'sco_id': sco.get('sco-id'),
'url': room.acc.make_url(sco.findtext('url-path')),
+ 'dl': room.acc.make_dl_url(sco.findtext('url-path')),
'description': sco.findtext('description'),
'date_created': iso8601.parse_date(sco.findtext('date-created')),
'date_modified': iso8601.parse_date(sco.findtext('date-modified'))} for sco in r.et.findall(".//sco")]