31 from django.conf
import settings
32 from django.utils.translation
import ugettext_lazy
as _
34 from common.utils
import ServerProxy
35 from wi.utils.exceptions
import RestErrorException
36 from wi.utils.messages_ajax
import error, success
37 from wi.utils.messages_codes
import get_error, auth_error_text
40 REDIRECT_FIELD_NAME =
'next'
41 CLM = ServerProxy(settings.CLOUD_MANAGER_ADDRESS)
49 if response[
'status'] !=
'ok':
50 error_code = response[
'status']
58 raise RestErrorException(error_msg)
69 for dictionary
in list_of_dicts:
70 if dictionary.get(key) ==
None:
71 raise Exception(
"No key: " + key +
" in dictionary.")
72 if dictionary.get(key) == key_value:
84 for dictionary
in list_of_dicts:
85 if dictionary.get(key) ==
None:
86 raise Exception(
"No key: " + key +
" in dictionary.")
87 if dictionary.get(key)
in list_of_key_values:
88 ret.append(dictionary)