reconvert to user_guid to uuid4 (#10132)

This commit is contained in:
Josue Kouka 2016-02-29 17:34:33 +01:00
parent 3a89d3ef72
commit ac76ff79c4
1 changed files with 5 additions and 0 deletions

View File

@ -14,6 +14,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import uuid
import json
import logging
@ -58,9 +59,13 @@ class DemandBaseView(View, SingleObjectMixin):
missing_key = set(fields).difference(set(self.json_data.keys()))
if missing_key:
raise MissingKeyException('%s is required' %(missing_key.pop()))
for field in fields:
payload[field] = self.json_data[field]
if payload.get('user_guid', None):
payload['user_guid'] = str(uuid.UUID(payload['user_guid'], version=4))
return payload
def check_request_response(self, response):