Skip to content

🌐 Update Chinese translation for docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md#12028

Merged
alejsdev merged 6 commits intofastapi:masterfrom
xuvjso:dependencies-with-yield-docs-fix
Aug 19, 2024
Merged

🌐 Update Chinese translation for docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md#12028
alejsdev merged 6 commits intofastapi:masterfrom
xuvjso:dependencies-with-yield-docs-fix

Conversation

@xuvjso
Copy link
Copy Markdown
Contributor

@xuvjso xuvjso commented Aug 16, 2024

#10831 ensures that the code following yield executes after the response is create but before it is sent to the client. The statement in #3620 (comment) was outdated, it is now safe to commit the session after yield as the code is guaranteed to execute after the response is created but before it is sent.

def get_db() -> Session:
    session = SessionLocal()
    try:
        yield session
        session.commit()
    except:
        session.rollback()
        raise
    finally:
        session.close()

@github-actions github-actions bot added the docs Documentation about how to use FastAPI label Aug 16, 2024
@github-actions
Copy link
Copy Markdown
Contributor

@estebanx64 estebanx64 added lang-zh Chinese translations awaiting-review labels Aug 16, 2024
@estebanx64 estebanx64 changed the title Update docs about dependencies with yield 🌐 Update docs about dependencies with yield Aug 16, 2024
@estebanx64
Copy link
Copy Markdown
Contributor

Thanks for your time and interest in helping us! 🙇

We are going to review these little changes 🤓

@estebanx64 estebanx64 added lang-all Translations and removed docs Documentation about how to use FastAPI labels Aug 16, 2024
@github-actions github-actions bot added the docs Documentation about how to use FastAPI label Aug 16, 2024
@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@xuvjso
Copy link
Copy Markdown
Contributor Author

xuvjso commented Aug 17, 2024

I noticed that the chinese version of the "dependencies with yield" section of the documentation is outdated, so I provided an updated translation to prevent users from being misled by outdated information and to align with the latest English documentation.

@alejsdev alejsdev removed the docs Documentation about how to use FastAPI label Aug 19, 2024
@alejsdev
Copy link
Copy Markdown
Member

Hi @xuvjso
Thanks for your interest in contributing to FastAPI 🙇‍♀️
To avoid problems with the labels. Could you better separate the EN from the ZH docs in another PR? Thanks in advance! 🙏

@github-actions github-actions bot added the docs Documentation about how to use FastAPI label Aug 19, 2024
@github-actions
Copy link
Copy Markdown
Contributor

@alejsdev alejsdev removed the docs Documentation about how to use FastAPI label Aug 19, 2024
@alejsdev alejsdev merged commit f0866bc into fastapi:master Aug 19, 2024
@alejsdev
Copy link
Copy Markdown
Member

alejsdev commented Aug 19, 2024

Great! Thanks for your contribution 🥳 @xuvjso
And thanks for the review 💯 @Aruelius

@alejsdev alejsdev changed the title 🌐 Update docs about dependencies with yield 🌐 Update Chinese translation for docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md Aug 19, 2024
@xuvjso
Copy link
Copy Markdown
Contributor Author

xuvjso commented Aug 19, 2024

Great! Thanks for your contribution 🥳 @xuvjso And thanks for the review 💯 @Aruelius

It's my pleasure. 😊

@xuvjso xuvjso deleted the dependencies-with-yield-docs-fix branch August 19, 2024 17:50
black-redoc pushed a commit to black-redoc/fastapi that referenced this pull request Sep 12, 2024
black-redoc pushed a commit to black-redoc/fastapi that referenced this pull request Sep 12, 2024
black-redoc pushed a commit to black-redoc/fastapi that referenced this pull request Sep 12, 2024
s-rigaud pushed a commit to s-rigaud/fastapi that referenced this pull request Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-1 lang-all Translations lang-zh Chinese translations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants