Skip to content

Commit 2b345ef

Browse files
committed
Updated postman with gender and birthdate
1 parent 033b600 commit 2b345ef

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

PyMatcha.postman_collection.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@
13191319
"header": [],
13201320
"body": {
13211321
"mode": "raw",
1322-
"raw": "{\n\t\"orientation\": \"heterosexual\",\n\t\"bio\": \"Nunc faucibus velit metus, nec iaculis sem fringilla ut. Nullam vel vulputate diam. Vivamus vehicula, enim at hendrerit tincidunt, leo sapien maximus nisi, nec suscipit arcu nisi a turpis. Suspendisse rutrum quis quam et sollicitudin. Proin commodo justo non dui tempor, at maximus velit vulputate. Integer vitae porta nulla, ut congue est. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin purus ex, venenatis vel aliquet a, interdum sit amet quam. Donec ac volutpat dui. In ornare augue in nisi efficitur varius. Donec hendrerit nunc a pulvinar posuere. Donec malesuada eros quam, eget pharetra nunc elementum in.\",\n\t\"tags\": [\n\t\t\"bot\",\n\t\t\"robot\",\n\t\t\"postman\",\n\t\t\"sex\",\n\t\t\"friends\",\n\t\t\"drink\",\n\t\t\"smoke\"\n\t\t]\n}",
1322+
"raw": "{\n\t\"orientation\": \"heterosexual\",\n\t\"bio\": \"Nunc faucibus velit metus, nec iaculis sem fringilla ut. Nullam vel vulputate diam. Vivamus vehicula, enim at hendrerit tincidunt, leo sapien maximus nisi, nec suscipit arcu nisi a turpis. Suspendisse rutrum quis quam et sollicitudin. Proin commodo justo non dui tempor, at maximus velit vulputate. Integer vitae porta nulla, ut congue est. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin purus ex, venenatis vel aliquet a, interdum sit amet quam. Donec ac volutpat dui. In ornare augue in nisi efficitur varius. Donec hendrerit nunc a pulvinar posuere. Donec malesuada eros quam, eget pharetra nunc elementum in.\",\n\t\"tags\": [\n\t\t\"bot\",\n\t\t\"robot\",\n\t\t\"postman\",\n\t\t\"sex\",\n\t\t\"friends\",\n\t\t\"drink\",\n\t\t\"smoke\"\n\t\t],\n\t\"gender\": \"other\",\n\t\"birthdate\": 1590674628\n}",
13231323
"options": {
13241324
"raw": {
13251325
"language": "json"
@@ -1495,67 +1495,67 @@
14951495
],
14961496
"variable": [
14971497
{
1498-
"id": "b1180951-59af-4533-b1ef-89cba4c3a87b",
1498+
"id": "c93127c5-53b6-418a-8dde-326f3060929a",
14991499
"key": "host",
15001500
"value": "http://127.0.0.1:5000",
15011501
"type": "string"
15021502
},
15031503
{
1504-
"id": "1515f3bd-a9b1-4a08-9c0f-21aa1933edc0",
1504+
"id": "c0f8da9e-693a-49a2-b9b4-547b81a931dd",
15051505
"key": "user_id",
15061506
"value": "",
15071507
"type": "string"
15081508
},
15091509
{
1510-
"id": "0894f3b3-3d31-4bd0-a1b8-ab95c8078037",
1510+
"id": "e812d2b5-9edf-4929-9bca-64385a2f8fee",
15111511
"key": "user_email",
15121512
"value": "foo@example.org",
15131513
"type": "string"
15141514
},
15151515
{
1516-
"id": "5211c78f-5d86-4bba-bf5e-e5654918b50d",
1516+
"id": "2b497dba-272c-458e-a66b-bc2470f7f0cc",
15171517
"key": "user_username",
15181518
"value": "bar",
15191519
"type": "string"
15201520
},
15211521
{
1522-
"id": "de2fec5e-d349-4fa4-bf7f-fae061264a71",
1522+
"id": "f0e4819d-a3ee-4f0a-a175-801c3eb06e70",
15231523
"key": "user_password",
15241524
"value": "admin",
15251525
"type": "string"
15261526
},
15271527
{
1528-
"id": "c3ce41b9-6851-477f-b745-66b427934bc8",
1528+
"id": "1bc72851-3589-4f59-9ca2-cbb22ae044b9",
15291529
"key": "user_firstname",
15301530
"value": "Foo",
15311531
"type": "string"
15321532
},
15331533
{
1534-
"id": "a25c1222-84ea-4d47-b8d3-f22a54d1d49f",
1534+
"id": "56678e7a-8172-4342-b939-076286a713da",
15351535
"key": "user_lastname",
15361536
"value": "Bar",
15371537
"type": "string"
15381538
},
15391539
{
1540-
"id": "0568293c-5883-41e1-a684-f6dbaaf73623",
1540+
"id": "3fab058a-563a-4ce8-a967-4c3f54bc8d10",
15411541
"key": "debug_token",
15421542
"value": "xX69jules69Xx",
15431543
"type": "string"
15441544
},
15451545
{
1546-
"id": "aa8e48a3-11c0-48d9-bdab-4887c1d5b121",
1546+
"id": "40f0d53a-930b-4b6d-8748-7b05d6154c2c",
15471547
"key": "user_access_token",
15481548
"value": "",
15491549
"type": "string"
15501550
},
15511551
{
1552-
"id": "08788a8b-e5db-4841-9021-3f95c4fc0607",
1552+
"id": "c9617f1e-454a-457c-af53-2b37e5d0fdb4",
15531553
"key": "user_refresh_token",
15541554
"value": "",
15551555
"type": "string"
15561556
},
15571557
{
1558-
"id": "26e146a6-35e0-4436-a1d5-bacc245090b3",
1558+
"id": "f65ff0a6-1581-408a-af30-5d02554d0af5",
15591559
"key": "expired_token",
15601560
"value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1OTAyNDIyNjQsIm5iZiI6MTU5MDI0MjI2NCwianRpIjoiNTM0ZGI5NzQtOWE4Ni00MGViLWE1NDEtMDg3N2ZmNzQ3NDVhIiwiZXhwIjoxNTkwMjQyMzI0LCJpZGVudGl0eSI6eyJpZCI6NTEyLCJlbWFpbCI6ImZvb0BleGFtcGxlLm9yZyIsInVzZXJuYW1lIjoiYmFyIiwiaXNfb25saW5lIjp0cnVlLCJkYXRlX2xhc3RzZWVuIjoiU2F0LCAyMyBNYXkgMjAyMCAxMzo1Nzo0NCBHTVQifSwiZnJlc2giOnRydWUsInR5cGUiOiJhY2Nlc3MifQ.NTp2P0WNkXDwzuzrcNIQdeAfizQ57HQgkzBLSvY1yHU",
15611561
"type": "string"

backend/PyMatcha/routes/api/profile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
profile_bp = Blueprint("profile", __name__)
3434

35-
REQUIRED_PARAMS_COMPLETE_PROFILE = {"gender": str, "birthdate": str, "orientation": str, "bio": str, "tags": list}
35+
REQUIRED_PARAMS_COMPLETE_PROFILE = {"gender": str, "birthdate": int, "orientation": str, "bio": str, "tags": list}
3636

3737

3838
@profile_bp.route("/profile/complete", methods=["POST"])
@@ -49,7 +49,7 @@ def complete_profile():
4949
bio = data["bio"]
5050
tags = data["tags"]
5151
gender = data["gender"]
52-
birthday = data["birthdate"]
52+
birthdate = data["birthdate"]
5353

5454
if orientation not in ["heterosexual", "homosexual", "bisexual", "other"]:
5555
raise BadRequestError("Orientation must be heterosexual, homosexual, bisexual or other", "Try again")
@@ -64,6 +64,6 @@ def complete_profile():
6464
current_user.bio = bio
6565
current_user.is_profile_completed = True
6666
current_user.gender = gender
67-
current_user.birthday = datetime.date.fromtimestamp(birthday)
67+
current_user.birthdate = datetime.date.fromtimestamp(int(birthdate))
6868
current_user.save()
6969
return Success("Profile completed !")

0 commit comments

Comments
 (0)