From faefe18e043a7ab860a3a4e885e2e75f909e3a55 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 8 May 2018 18:26:42 +0200 Subject: [PATCH] API & Client: profile edition refactor --- mpwo_api/mpwo_api/tests/test_auth.py | 2 +- mpwo_api/mpwo_api/users/auth.py | 2 +- mpwo_client/src/components/User/ProfileEdit.jsx | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/mpwo_api/mpwo_api/tests/test_auth.py b/mpwo_api/mpwo_api/tests/test_auth.py index e2c16cff..1d3c9d2b 100644 --- a/mpwo_api/mpwo_api/tests/test_auth.py +++ b/mpwo_api/mpwo_api/tests/test_auth.py @@ -429,7 +429,7 @@ def test_user_profile_valid_update(app): last_name='Doe', location='Somewhere', bio='just a random guy', - birth_date='01/01/1980' + birth_date='1980-01-01' )), headers=dict( Authorization='Bearer ' + json.loads( diff --git a/mpwo_api/mpwo_api/users/auth.py b/mpwo_api/mpwo_api/users/auth.py index 9d79c6e1..0fbb6fc6 100644 --- a/mpwo_api/mpwo_api/users/auth.py +++ b/mpwo_api/mpwo_api/users/auth.py @@ -207,7 +207,7 @@ def edit_user(user_id): user.bio = bio user.location = location user.birth_date = ( - datetime.datetime.strptime(birth_date, '%d/%m/%Y') + datetime.datetime.strptime(birth_date, '%Y-%m-%d') if birth_date else None ) diff --git a/mpwo_client/src/components/User/ProfileEdit.jsx b/mpwo_client/src/components/User/ProfileEdit.jsx index e04142d1..f4a72cbe 100644 --- a/mpwo_client/src/components/User/ProfileEdit.jsx +++ b/mpwo_client/src/components/User/ProfileEdit.jsx @@ -120,9 +120,7 @@ class ProfileEdit extends React.Component {