File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 1
- import datetime
2
- from datetime import timezone
3
1
import logging
2
+ from datetime import datetime , timezone
4
3
5
- import connexion
6
4
import orm
7
- from connexion import NoContent
8
-
5
+ from connexion import FlaskApp , NoContent
9
6
10
7
def get_pets (limit , animal_type = None ):
11
8
with db_session_factory () as db_session :
@@ -30,7 +27,7 @@ def put_pet(pet_id, pet):
30
27
p .update (** pet )
31
28
else :
32
29
logging .info ("Creating pet %s.." , pet_id )
33
- pet ["created" ] = datetime .datetime . now (timezone .UTC )
30
+ pet ["created" ] = datetime .now (timezone .UTC )
34
31
db_session .add (orm .Pet (** pet ))
35
32
db_session .commit ()
36
33
return NoContent , (200 if p is not None else 201 )
@@ -57,7 +54,7 @@ def delete_pet(pet_id):
57
54
}
58
55
for id_ , pet in pets .items ():
59
56
put_pet (id_ , pet )
60
- app = connexion . FlaskApp (__name__ , specification_dir = "spec" )
57
+ app = FlaskApp (__name__ , specification_dir = "spec" )
61
58
app .add_api ("openapi.yaml" )
62
59
app .add_api ("swagger.yaml" )
63
60
You can’t perform that action at this time.
0 commit comments