From 4e10300880442d4662ae4124ab8be1cee8071eef Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Fri, 11 Feb 2011 22:18:32 +0100 Subject: fix uniqueness bugs --- src/meetingtools/apps/room/models.py | 6 +++--- src/meetingtools/apps/room/views.py | 6 ++++-- src/meetingtools/urls.py | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/meetingtools/apps/room/models.py b/src/meetingtools/apps/room/models.py index d69ee93..9c2c489 100644 --- a/src/meetingtools/apps/room/models.py +++ b/src/meetingtools/apps/room/models.py @@ -12,14 +12,14 @@ from meetingtools.apps.cluster.models import ACCluster class Room(models.Model): creator = ForeignKey(User,editable=False) - name = CharField(max_length=128,blank=True,unique=True) - urlpath = CharField(max_length=128,blank=True,unique=True) + name = CharField(max_length=128,unique=True) + urlpath = CharField(max_length=128,unique=True) acc = ForeignKey(ACCluster,verbose_name="Adobe Connect Cluster",editable=False) participants = CharField(max_length=255,blank=True,verbose_name="Participants") # populate from entitlement held by creator session presenters = CharField(max_length=255,blank=True,verbose_name="Presenters") # populate from entitlement held by creator session hosts = CharField(max_length=255,blank=True,verbose_name="Hosts") # populate from entitlement held by creator session self_cleaning = BooleanField(verbose_name="Clean-up when empty?") - sco_id = IntegerField(verbose_name="Adobe Connect Room",blank=False) + sco_id = IntegerField(verbose_name="Adobe Connect Room") source_sco_id = IntegerField(verbose_name="Template",blank=True,null=True) folder_sco_id = IntegerField(verbose_name="Adobe Connect Room Folder",editable=False) timecreated = models.DateTimeField(auto_now_add=True) diff --git a/src/meetingtools/apps/room/views.py b/src/meetingtools/apps/room/views.py index 2921489..85b44e2 100644 --- a/src/meetingtools/apps/room/views.py +++ b/src/meetingtools/apps/room/views.py @@ -205,8 +205,6 @@ def _import_room(request,acc,sco_id,source_sco_id,folder_sco_id,name,urlpath): logging.debug(room.id) room.save() - - return room @login_required @@ -229,6 +227,10 @@ def list(request): r.delete() return respond_to(request,{'text/html':'apps/room/list.html'},{'user':request.user,'rooms':Room.objects.filter(creator=request.user).all()}) +def rooms_by_group(request,group): + for room in Room.objects.filter(participants=group): + pass + @login_required def delete(request,id): room = get_object_or_404(Room,pk=id) diff --git a/src/meetingtools/urls.py b/src/meetingtools/urls.py index c07f3e3..3e6e652 100644 --- a/src/meetingtools/urls.py +++ b/src/meetingtools/urls.py @@ -21,6 +21,7 @@ urlpatterns = patterns('', (r'^accounts/login-federated/$','meetingtools.apps.auth.views.accounts_login_federated'), (r'^accounts/logout/$','meetingtools.apps.auth.views.logout'), (r'^rooms?$','meetingtools.apps.room.views.list'), + (r'^rooms/(.+)(?:\.([^\.]+))?$','meetingtools.apps.room.views.rooms_by_group'), (r'^go/(\d+)$','meetingtools.apps.room.views.go_by_id'), (r'^go/(.+)$','meetingtools.apps.room.views.go_by_path'), (r'^room/create$','meetingtools.apps.room.views.update'), -- cgit v1.1