summaryrefslogtreecommitdiff
path: root/src/meetingtools
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2011-10-11 17:23:34 +0200
committerLeif Johansson <leifj@sunet.se>2011-10-11 17:23:34 +0200
commite70433a0d9b4382543476929f989be8d74231612 (patch)
tree26fafee6d642850998af41c7cf6ecae3156d44af /src/meetingtools
parent3be1252078f9e0bbfd89cdf03cf994756d4ff4af (diff)
default template per cluster
Diffstat (limited to 'src/meetingtools')
-rw-r--r--src/meetingtools/apps/cluster/models.py3
-rw-r--r--src/meetingtools/apps/room/views.py7
2 files changed, 7 insertions, 3 deletions
diff --git a/src/meetingtools/apps/cluster/models.py b/src/meetingtools/apps/cluster/models.py
index 9921dd4..13b4aae 100644
--- a/src/meetingtools/apps/cluster/models.py
+++ b/src/meetingtools/apps/cluster/models.py
@@ -5,7 +5,7 @@ Created on Feb 3, 2011
'''
from django.db import models
-from django.db.models.fields import CharField, URLField, TextField
+from django.db.models.fields import CharField, URLField, TextField, IntegerField
class ACCluster(models.Model):
api_url = URLField()
@@ -13,6 +13,7 @@ class ACCluster(models.Model):
user = CharField(max_length=128)
password = CharField(max_length=128)
name = CharField(max_length=128,blank=True,unique=True)
+ default_template_sco_id = IntegerField(blank=True,unique=True)
domain_match = TextField()
def __unicode__(self):
diff --git a/src/meetingtools/apps/room/views.py b/src/meetingtools/apps/room/views.py
index 66d13cc..c2c02f2 100644
--- a/src/meetingtools/apps/room/views.py
+++ b/src/meetingtools/apps/room/views.py
@@ -190,7 +190,10 @@ def _update_room(request, room, form=None):
def create(request):
acc = _acc_for_user(request.user)
my_meetings_sco_id = _user_meeting_folder(request,acc)
- room = Room(creator=request.user,acc=acc,folder_sco_id=my_meetings_sco_id,source_sco_id=DEFAULT_TEMPLATE_SCO)
+ template_sco_id = acc.default_template_sco_id
+ if not template_sco_id:
+ template_sco_id = DEFAULT_TEMPLATE_SCO
+ room = Room(creator=request.user,acc=acc,folder_sco_id=my_meetings_sco_id,source_sco_id=template_sco_id)
what = "Create"
title = "Create a new room"
@@ -312,7 +315,7 @@ def delete(request,id):
def _clean(request,room):
api = ac_api_client(request, room.acc)
- api.request('sco-delete',{'sco-id':room.sco_id},raise_error=True)
+ api.request('sco-delete',{'sco-id':room.sco_id},raise_error=False)
room.sco_id = None
return _update_room(request, room)