changeset 601:2aa75cf87a0d

bbb: create_meeting action checks if meeting name already exist and rejects
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Thu, 14 Jun 2012 10:42:02 +0200
parents 43461463758f
children ba791ad6c846
files data/plugin/action/submit_bbb_create_meeting.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/submit_bbb_create_meeting.py	Thu Jun 14 10:19:11 2012 +0200
+++ b/data/plugin/action/submit_bbb_create_meeting.py	Thu Jun 14 10:42:02 2012 +0200
@@ -52,6 +52,12 @@
             return
 
         sub_pagename = u'%s/%s' % (pagename, request.form["meeting_name"])
+        if Page(request, sub_pagename).exists():
+            msg, state = ("Sorry, a meeting with that name %(meeting_name)s already exists!" % {"meeting_name": request.form["meeting_name"]}, "error")
+            request.theme.add_msg(msg, state)
+            Page(request, pagename).send_page()
+            return
+
         keyval = "\n".join([' %s:: %s' % (key, value) for key, value in request.form.iteritems() if not (key.startswith('labels') or key.startswith('action') or key.startswith('doit'))])
         result = """#acl %(username)s:admin,read,write,delete,revert %(bbb_admin_group)s:read All:
 #format bbb_create