1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-01-08 21:18:00 +03:00

Added DJango request to values dictionary, passed at authenticator initialization (we may need request object to, for example, generate uniques ids based on server address, and request object can provide this)

This commit is contained in:
Adolfo Gómez 2012-07-24 23:43:32 +00:00
parent e9c4197f14
commit f7703ff992

View File

@ -148,6 +148,7 @@ def createAuthenticator(credentials, type, data):
'''
dict_ = dictFromData(data)
# First create data without serialization, then serialies data with correct environment
dict_['request'] = credentials.request
auth = None
try:
auth = Authenticator.objects.create(name = dict_['name'], comments = dict_['comments'], data_type = type, priority=int(dict_['priority']))
@ -178,6 +179,7 @@ def modifyAuthenticator(credentials, id, data):
try:
auth = Authenticator.objects.get(pk=id)
dict_ = dictFromData(data)
dict_['request'] = credentials.request
a = auth.getInstance(dict_)
auth.data = a.serialize()
auth.name = dict_['name']