예제 #1
0
파일: forms.py 프로젝트: wendy-king/x7_venv
 def __init__(self, request, *args, **kwargs):
     super(BaseUserForm, self).__init__(*args, **kwargs)
     # Populate tenant choices
     tenant_choices = [('', "Select a tenant")]
     for tenant in api.tenant_list(request):
         if tenant.enabled:
             tenant_choices.append((tenant.id, tenant.name))
     self.fields['tenant_id'].choices = tenant_choices
예제 #2
0
파일: forms.py 프로젝트: wendy-king/x7_venv
 def __init__(self, request, *args, **kwargs):
     super(BaseUserForm, self).__init__(*args, **kwargs)
     # Populate tenant choices
     tenant_choices = [('', "Select a tenant")]
     for tenant in api.tenant_list(request):
         if tenant.enabled:
             tenant_choices.append((tenant.id, tenant.name))
     self.fields['tenant_id'].choices = tenant_choices
예제 #3
0
파일: forms.py 프로젝트: wendy-king/x7_venv
 def __init__(self, request, *args, **kwargs):
     super(DownloadOpenRCForm, self).__init__(*args, **kwargs)
     # Populate tenant choices
     tenant_choices = []
     for tenant in api.tenant_list(request):
         if tenant.enabled:
             tenant_choices.append((tenant.id, tenant.name))
     self.fields["tenant"].choices = tenant_choices
예제 #4
0
 def get_data(self):
     tenants = []
     try:
         tenants = api.tenant_list(self.request)
     except api_exceptions.AuthorizationFailure, e:
         LOG.exception("Unauthorized attempt to list tenants.")
         messages.error(self.request, _('Unable to get tenant info: %s')
                                      % e.message)