diff options
Diffstat (limited to 'src/meetingtools/apps')
-rw-r--r-- | src/meetingtools/apps/auth/views.py | 11 | ||||
-rw-r--r-- | src/meetingtools/apps/cluster/models.py | 4 | ||||
-rw-r--r-- | src/meetingtools/apps/room/forms.py | 13 |
3 files changed, 16 insertions, 12 deletions
diff --git a/src/meetingtools/apps/auth/views.py b/src/meetingtools/apps/auth/views.py index 4ce8162..e294b0c 100644 --- a/src/meetingtools/apps/auth/views.py +++ b/src/meetingtools/apps/auth/views.py @@ -120,6 +120,10 @@ def accounts_login_federated(request): #profile.lastupdated = datetime.datetime.now() profile.save() + next = request.session.get("after_login_redirect", None) + if not next and request.GET.has_key('next'): + next = request.GET['next'] + acc = acc_for_user(request.user) with ac_api_client(request) as api: # make sure the principal is created before shooting off @@ -154,12 +158,9 @@ def accounts_login_federated(request): # group = connect_api.find_or_create_principal('name',e,'group',{'type': 'group','has-children':'1','name': e}) # if group: # connect_api.add_remove_member(principal.get('principal-id'),group.get('principal-id'),True) - - next = request.session.get("after_login_redirect", None) - if not next and request.GET.has_key('next'): - next = request.GET['next'] + if next is not None: return redirect_to(next) else: pass - return redirect_to("/") + return redirect_to(next) diff --git a/src/meetingtools/apps/cluster/models.py b/src/meetingtools/apps/cluster/models.py index 7b59771..3c65d57 100644 --- a/src/meetingtools/apps/cluster/models.py +++ b/src/meetingtools/apps/cluster/models.py @@ -30,6 +30,6 @@ def acc_for_user(user): domain = "nordu.net" # testing with local accts only for acc in ACCluster.objects.all(): for regex in acc.domain_match.split(): - if re.match(regex,domain): + if re.match(regex.strip(),domain): return acc - raise Exception,"I don't know which cluster you belong to... (%s)" % user.username
\ No newline at end of file + raise Exception,"I don't know which cluster you belong to... (%s)" % user.username diff --git a/src/meetingtools/apps/room/forms.py b/src/meetingtools/apps/room/forms.py index 79daeb3..62b515b 100644 --- a/src/meetingtools/apps/room/forms.py +++ b/src/meetingtools/apps/room/forms.py @@ -5,7 +5,7 @@ Created on Feb 1, 2011 ''' from meetingtools.apps.room.models import Room -from django.forms.widgets import Select, TextInput, RadioSelect +from django.forms.widgets import Select, TextInput, RadioSelect, Textarea from django.forms.fields import BooleanField, ChoiceField, CharField from django.forms.forms import Form from form_utils.forms import BetterModelForm @@ -22,16 +22,18 @@ class PrefixTextInput(TextInput): self.prefix = prefix def render(self, name, value, attrs=None): - return mark_safe("<b>"+self.prefix+"</b> "+super(PrefixTextInput, self).render(name, value, attrs)) + return mark_safe("<div class=\"input-prepend\"><span class=\"add-on\">"+self.prefix+"</span>"+ + super(PrefixTextInput, self).render(name, value, attrs)+"</span></div>") class ModifyRoomForm(ModelForm): class Meta: model = Room fields = ['name','description','source_sco_id','self_cleaning','allow_host'] widgets = {'source_sco_id': Select(), + 'description': Textarea(attrs={'rows': 4, 'cols': 50}), 'name': TextInput(attrs={'size': '40'})} - - + + class CreateRoomForm(BetterModelForm): access = ChoiceField(choices=(('public','Public'),('private','Private'))) @@ -69,7 +71,8 @@ class CreateRoomForm(BetterModelForm): }), ] widgets = {'access': RadioSelect(), - 'urlpath': PrefixTextInput(attrs={'size': '15'}), + 'urlpath': PrefixTextInput(attrs={'size': '10'}), + 'description': Textarea(attrs={'rows': 4, 'cols': 50}), 'name': TextInput(attrs={'size': '40'})} class DeleteRoomForm(Form): |