~ubuntu-branches/ubuntu/precise/horizon/precise-updates

« back to all changes in this revision

Viewing changes to .pc/git-2012.1~e2~20111201.1077.patch/openstack-dashboard/dashboard/views.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-09 16:18:55 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20111209161855-nguyenpghx2o2lqy
Tags: 2012.1~e2~20111209.1104-0ubuntu1
* New upstream release.
* Refreshed patches.
* debian/docs: Removed README

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
 
 
3
 
# Copyright 2011 United States Government as represented by the
4
 
# Administrator of the National Aeronautics and Space Administration.
5
 
# All Rights Reserved.
6
 
#
7
 
# Copyright 2011 Nebula, Inc.
8
 
#
9
 
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
10
 
#    not use this file except in compliance with the License. You may obtain
11
 
#    a copy of the License at
12
 
#
13
 
#         http://www.apache.org/licenses/LICENSE-2.0
14
 
#
15
 
#    Unless required by applicable law or agreed to in writing, software
16
 
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17
 
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18
 
#    License for the specific language governing permissions and limitations
19
 
#    under the License.
20
 
 
21
 
"""
22
 
Views for home page.
23
 
"""
24
 
from django import template
25
 
from django import shortcuts
26
 
from django.views.decorators import vary
27
 
 
28
 
import horizon
29
 
from horizon.views import auth as auth_views
30
 
 
31
 
 
32
 
def qunit_tests(request):
33
 
    return shortcuts.render(request, "qunit.html")
34
 
 
35
 
 
36
 
def user_home(user):
37
 
    if user.admin:
38
 
        return horizon.get_dashboard('syspanel').get_absolute_url()
39
 
    return horizon.get_dashboard('nova').get_absolute_url()
40
 
 
41
 
 
42
 
@vary.vary_on_cookie
43
 
def splash(request):
44
 
    form, handled = auth_views.Login.maybe_handle(request)
45
 
    if handled:
46
 
        return handled
47
 
 
48
 
    return shortcuts.render(request, 'splash.html', {'form': form})