Skip to content

Commit cd4a8f4

Browse files
authored
fix small typo and change the contribution docs (#291)
* fix small typo and change the contribution docs * fix tests with the latest Piccolo ORM changes * remove accidentally left postgres password
1 parent 5634e77 commit cd4a8f4

File tree

4 files changed

+19
-16
lines changed

4 files changed

+19
-16
lines changed

docs/source/contributing/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ The docs are written using Sphinx. To get them running locally:
3131
* Install the requirements: ``pip install -r requirements/doc-requirements.txt``
3232
* ``cd docs``
3333
* Do an initial build of the docs: ``make html``
34-
* Serve the docs: ``scripts/run-docs.sh``
34+
* ``cd ..``
35+
* Serve the docs: ``./scripts/run-docs.sh``
3536
* The docs will auto rebuild as you make changes.
3637

3738
-------------------------------------------------------------------------------

docs/source/register/endpoints.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Here's a Starlette example:
3232
3333
app = Starlette()
3434
35-
app.mount('/register/', register(redirect_to="/login/"))
35+
app.mount("/register/", register(redirect_to="/login/"))
3636
3737
Here's a FastAPI example:
3838

@@ -43,7 +43,7 @@ Here's a FastAPI example:
4343
4444
app = FastAPI()
4545
46-
app.mount('/register/', register(redirect_to="/login/"))
46+
app.mount("/register/", register(redirect_to="/login/"))
4747
4848
Security
4949
~~~~~~~~
@@ -70,7 +70,7 @@ Modifying the FastAPI example above:
7070
app = FastAPI()
7171
7272
app.mount(
73-
'/register/',
73+
"/register/",
7474
RateLimitingMiddleware(
7575
register(redirect_to="/login/"),
7676
InMemoryLimitProvider(
@@ -104,24 +104,24 @@ following:
104104
105105
# To use hCaptcha:
106106
app.mount(
107-
'/register/',
107+
"/register/",
108108
register(
109109
redirect_to="/login/",
110110
captcha=hcaptcha(
111-
site_key='my-site-key',
112-
secret_key='my-secret-key',
111+
site_key="my-site-key",
112+
secret_key="my-secret-key",
113113
)
114114
)
115115
)
116116
117117
# To use reCAPTCHA:
118118
app.mount(
119-
'/register/',
119+
"/register/",
120120
register(
121121
redirect_to="/login/",
122122
captcha=recaptcha_v2(
123-
site_key='my-site-key',
124-
secret_key='my-secret-key',
123+
site_key="my-site-key",
124+
secret_key="my-secret-key",
125125
)
126126
)
127127
)

docs/source/session_auth/endpoints.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Here's a Starlette example:
4646
4747
app = Starlette()
4848
49-
app.mount('/login/', session_login())
49+
app.mount("/login/", session_login())
5050
5151
Here's a FastAPI example:
5252

@@ -57,7 +57,7 @@ Here's a FastAPI example:
5757
5858
app = FastAPI()
5959
60-
app.mount('/login/', session_login())
60+
app.mount("/login/", session_login())
6161
6262
Source
6363
~~~~~~
@@ -95,7 +95,7 @@ Here's a Starlette example:
9595
9696
app = Starlette()
9797
98-
app.mount('/logout/', session_logout())
98+
app.mount("/logout/", session_logout())
9999
100100
Here's a FastAPI example:
101101

@@ -106,7 +106,7 @@ Here's a FastAPI example:
106106
107107
app = FastAPI()
108108
109-
app.mount('/login/', session_logout())
109+
app.mount("/logout/", session_logout())
110110
111111
112112
Source

tests/crud/test_crud_endpoints.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,9 @@ def test_patch_user_fails(self):
277277

278278
response = client.patch(f"/{user['id']}/", json=json)
279279
self.assertEqual(response.status_code, 400)
280-
self.assertEqual(response.content, b"The password is too short.")
280+
self.assertEqual(
281+
response.content, b"The password is too short. (min 6)"
282+
)
281283

282284
def test_patch_fails(self):
283285
"""
@@ -1353,7 +1355,7 @@ def test_post_user_fails(self):
13531355

13541356
response = client.post("/", json=json)
13551357
self.assertEqual(
1356-
response.content, b"Error: The password is too short."
1358+
response.content, b"Error: The password is too short. (min 6)"
13571359
)
13581360
self.assertEqual(response.status_code, 400)
13591361

0 commit comments

Comments
 (0)