Skip to content

Commit 8036f4d

Browse files
committed
address chapter13 review
move TIP, fix emdashes, add OK test output
1 parent 2239e5c commit 8036f4d

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

chapter_13_database_layer_validation.asciidoc

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ if you are not convinced yet.
270270
Client-side validation will provide faster feedback on the UI, but
271271
https://cheatsheetseries.owasp.org/cheatsheets/Input_Validation_Cheat_Sheet.html#client-side-vs-server-side-validation[it is not a security measure.]
272272
Server-side validation is indispensable for handling any input
273-
that gets processed by the server -- and it will also provide albeit slower,
273+
that gets processed by the server--and it will also provide albeit slower,
274274
feedback for the client side.]
275275

276276

@@ -580,7 +580,7 @@ Not quite, but they did get a little further. Checking the line in which the
580580
error occurred -- 'line 31' in my case -- , we can
581581
// CSANAD: I think emphasizing what to look for in the error log is helpful.
582582
see that we've got past the first part of the test, and are now onto the second
583-
check -- that submitting a second empty item also shows an error.
583+
check--that submitting a second empty item also shows an error.
584584

585585
((("", startref="MLVsurfac13")))We've
586586
got some working code though, so let's have a commit:
@@ -592,12 +592,6 @@ $ *git commit -am "Adjust new list view to do model validation"*
592592
----
593593

594594

595-
TIP: When working on a new feature, it's common to realize partway through that
596-
a refactor of the application is needed. Adding an early return to the FT
597-
you're currently working on allows you to perform this refactor against
598-
passing FTs, even while the feature is still in progress.
599-
600-
601595
Let's put an early return in the FT to separate
602596
what we got working from those that still need to be dealt with:
603597

@@ -633,6 +627,12 @@ We should also remind ourselves not to forget to remove this early return:
633627

634628
And now, we can focus on making our code a little neater.
635629

630+
TIP: When working on a new feature, it's common to realize partway through that
631+
a refactor of the application is needed. Adding an early return to the FT
632+
you're currently working on allows you to perform this refactor against
633+
passing FTs, even while the feature is still in progress.
634+
635+
636636

637637
=== Django Pattern: Processing POST Requests in the Same View as Renders the Form
638638

@@ -831,14 +831,21 @@ urlpatterns = [
831831
----
832832
====
833833

834-
And that gets us to the `OK`.
834+
And that gets us to the green on the unit tests.
835835

836836
----
837837
OK
838838
----
839839

840840

841841
Let's try a full FT run: they're all passing!
842+
843+
----
844+
Ran 4 tests in 20 s
845+
846+
OK
847+
----
848+
842849
Our refactor of the `add_item` functionality is complete.
843850
We should commit there:
844851

0 commit comments

Comments
 (0)