aboutsummaryrefslogtreecommitdiffstats
path: root/src/booking/lib.py
blob: 8132c7549a0245a0a35ccb2994a371b76afa5dde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
##############################################################################
# Copyright (c) 2019 Parker Berberian, Sawyer Bergeron, and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

from account.models import UserProfile


def get_user_field_opts():
    return {
        'show_from_noentry': False,
        'show_x_results': 5,
        'results_scrollable': True,
        'selectable_limit': -1,
        'placeholder': 'Search for other users',
        'name': 'users',
        'disabled': False
    }


def get_user_items(exclude=None):
    qs = UserProfile.objects.select_related('user').exclude(user=exclude)
    items = {}
    for up in qs:
        item = {
            'id': up.id,
            'expanded_name': up.full_name,
            'small_name': up.user.username,
            'string': up.email_addr
        }
        items[up.id] = item
    return items
span>admin export OS_PASSWORD=${ADMIN_PASSWORD} export OS_REGION_NAME=Orange export OS_TENANT_NAME=admin export OS_AUTH_URL=http://localhost:5000/v3 export OS_DOMAIN_NAME=Default export OS_IDENTITY_API_VERSION=3 openstack project create --description "Service Project" demo openstack role create user openstack role add --project demo --user demo user echo -e "\n Project list:" openstack project list echo -e "\n Users list:" openstack user list echo -e "\n Roles list:" openstack role list echo -e "\n Service list:" openstack service list echo -e "\n Endpoint list:" openstack endpoint list tail -f /var/log/apache2/keystone.log