File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -58,15 +58,19 @@ def create(cls, **kwargs):
58
58
"""Create an instance and save it."""
59
59
response = cls .connection ().post (cls .ENDPOINT , json = kwargs )
60
60
61
- if response .status_code != 200 :
61
+ if response .status_code not in ( 200 , 202 ) :
62
62
raise HTTPError (response .content .decode ())
63
63
64
64
return cls (** response .json ())
65
65
66
66
67
67
class UpdateResource (Resource ):
68
68
def update (self , ** kwargs ) -> None :
69
- """Update an instance."""
69
+ """
70
+ Update an instance by providing function arguments.
71
+ Providing any argument with metabase.MISSING will result in this argument being
72
+ ignored from the request.
73
+ """
70
74
params = {k : v for k , v in kwargs .items () if v != MISSING }
71
75
response = self .connection ().put (self .ENDPOINT + f"/{ getattr (self , self .PRIMARY_KEY )} " , json = params )
72
76
You can’t perform that action at this time.
0 commit comments