8000 updated · wpcodevo/python_fastapi@ed79c1a · GitHub
[go: up one dir, main page]

Skip to content

Commit ed79c1a

Browse files
committed
updated
1 parent 066869c commit ed79c1a

File tree

4 files changed

+39
-38
lines changed

4 files changed

+39
-38
lines changed

.env

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ VERIFICATION_SECRET=my-email-verification-secret
1515

1616
EMAIL_HOST=smtp.mailtrap.io
1717
EMAIL_PORT=587
18-
EMAIL_USERNAME=4aeca0c9318dd2
19-
EMAIL_PASSWORD=a987a0e0eac00d
18+
EMAIL_USERNAME=41fa1d7c714ab0
19+
EMAIL_PASSWORD=608f76636315f5
2020
EMAIL_FROM=admin@admin.com
2121

2222
JWT_PRIVATE_KEY=LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlCT2dJQkFBSkJBSSs3QnZUS0FWdHVQYzEzbEFkVk94TlVmcWxzMm1SVmlQWlJyVFpjd3l4RVhVRGpNaFZuCi9KVHRsd3h2a281T0pBQ1k3dVE0T09wODdiM3NOU3ZNd2xNQ0F3RUFBUUpBYm5LaENOQ0dOSFZGaHJPQ0RCU0IKdmZ2ckRWUzVpZXAwd2h2SGlBUEdjeWV6bjd0U2RweUZ0NEU0QTNXT3VQOXhqenNjTFZyb1pzRmVMUWlqT1JhUwp3UUloQU84MWl2b21iVGhjRkltTFZPbU16Vk52TGxWTW02WE5iS3B4bGh4TlpUTmhBaUVBbWRISlpGM3haWFE0Cm15QnNCeEhLQ3JqOTF6bVFxU0E4bHUvT1ZNTDNSak1DSVFEbDJxOUdtN0lMbS85b0EyaCtXdnZabGxZUlJPR3oKT21lV2lEclR5MUxaUVFJZ2ZGYUlaUWxMU0tkWjJvdXF4MHdwOWVEejBEWklLVzVWaSt6czdMZHRDdUVDSUVGYwo3d21VZ3pPblpzbnU1clBsTDJjZldLTGhFbWwrUVFzOCtkMFBGdXlnCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0t

app/email.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ async def sendMail(self, subject, template):
3232
MAIL_FROM=settings.EMAIL_FROM,
3333
MAIL_PORT=settings.EMAIL_PORT,
3434
MAIL_SERVER=settings.EMAIL_HOST,
35-
MAIL_TLS=True,
36-
MAIL_SSL=False,
35+
MAIL_STARTTLS=False,
36+
MAIL_SSL_TLS=False,
3737
USE_CREDENTIALS=True,
3838
VALIDATE_CERTS=True
3939
)

app/routers/post.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def update_post(id: str, post: schemas.UpdatePostSchema, db: Session = Depends(g
3838
if updated_post.user_id != uuid.UUID(user_id):
3939
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN,
4040
detail='You are not allowed to perform this action')
41-
post_query.update(post.dict(), synchronize_session=False)
41+
post.user_id = user_id
42+
post_query.update(post.dict(exclude_unset=True), synchronize_session=False)
4243
db.commit()
4344
return updated_post
4445

@@ -60,7 +61,7 @@ def delete_post(id: str, db: Session = Depends(get_db), user_id: str = Depends(r
6061
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND,
6162
detail=f'No post with this id: {id} found')
6263

63-
if post.owner_id != user_id:
64+
if str(post.user_id) != user_id:
6465
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN,
6566
detail='You are not allowed to perform this action')
6667
post_query.delete(synchronize_session=False)

requirements.txt

+32-32
Original file line numberDiff line numberDiff line change
@@ -1,46 +1 8000 ,46 @@
1-
alembic==1.8.0
2-
anyio==3.6.1
3-
asgiref==3.5.2
4-
autopep8==1.6.0
5-
bcrypt==3.2.2
6-
certifi==2022.6.15
1+
aiosmtplib==1.1.7
2+
alembic==1.9.0
3+
anyio==3.6.2
4+
autopep8==2.0.1
5+
bcrypt==4.0.1
6+
blinker==1.5
7+
certifi==2022.12.7
78
cffi==1.15.1
8-
charset-normalizer==2.1.0
99
click==8.1.3
10-
colorama==0.4.5
10+
colorama==0.4.6
1111
cryptography==3.4.8
1212
dnspython==2.2.1
13-
email-validator==1.2.1
14-
fastapi==0.78.0
13+
email-validator==1.3.0
14+
fastapi==0.88.0
1515
fastapi-jwt-auth==0.5.0
16-
greenlet==1.1.2
17-
h11==0.13.0
18-
httptools==0.4.0
19-
idna==3.3
16+
fastapi-mail==1.2.2
17+
greenlet==2.0.1
18+
h11==0.14.0
19+
httpcore==0.16.3
20+
httptools==0.5.0
21+
httpx==0.23.1
22+
idna==3.4
2023
itsdangerous==2.1.2
2124
Jinja2==3.1.2
22-
Mako==1.2.1
25+
Mako==1.2.4
2326
MarkupSafe==2.1.1
24-
orjson==3.7.6
27+
orjson==3.8.3
2528
passlib==1.7.4
26-
psycopg2==2.9.3
27-
pycodestyle==2.8.0
29+
psycopg2==2.9.5
30+
pycodestyle==2.10.0
2831
pycparser==2.21
29-
pydantic==1.9.1
32+
pydantic==1.10.2
3033
PyJWT==1.7.1
31-
python 9E88 -dotenv==0.20.0
34+
python-dotenv==0.21.0
3235
python-multipart==0.0.5
3336
PyYAML==6.0
34-
requests==2.28.1
37+
rfc3986==1.5.0
3538
six==1.16.0
36-
sniffio==1.2.0
37-
SQLAlchemy==1.4.39
38-
starlette==0.19.1
39-
toml==0.10.2
40-
typing_extensions==4.3.0
41-
tzdata==2022.1
42-
ujson==5.4.0
43-
urllib3==1.26.9
44-
uvicorn==0.17.6
45-
watchgod==0.8.2
46-
websockets==10.3
39+
sniffio==1.3.0
40+
SQLAlchemy==1.4.45
41+
starlette==0.21.0
42+
typing_extensions==4.4.0
43+
ujson==5.6.0
44+
uvicorn==0.20.0
45+
watchfiles==0.18.1
46+
websockets==10.4

0 commit comments

Comments
 (0)
0