File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
flask-connexion-rest-part-2/version_1 Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ def create(person):
9797def update (person_id , person ):
9898 """
9999 This function updates an existing person in the people structure
100- Throws an error if a person with the name we want to update to
100+ Throws an error if a person with the name we want to update to
101101 already exists in the database.
102102
103103 :param person_id: Id of the person to update in the people structure
@@ -109,7 +109,7 @@ def update(person_id, person):
109109 Person .person_id == person_id
110110 ).one_or_none ()
111111
112- # Try to find an existing person with the same name that we want to update to
112+ # Try to find an existing person with the same name as the update
113113 fname = person .get ("fname" )
114114 lname = person .get ("lname" )
115115
@@ -126,8 +126,10 @@ def update(person_id, person):
126126 "Person not found for Id: {person_id}" .format (person_id = person_id ),
127127 )
128128
129- # But would our update create a duplicate of another person that already exists?
130- elif existing_person is not None and existing_person .person_id != person_id :
129+ # Would our update create a duplicate of another person already existing?
130+ elif (
131+ existing_person is not None and existing_person .person_id != person_id
132+ ):
131133 abort (
132134 409 ,
133135 "Person {fname} {lname} exists already" .format (
You can’t perform that action at this time.
0 commit comments