mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
Allow None as a valid value for an optional parameter (fix testEditOrganization)
This commit is contained in:
@@ -3,6 +3,11 @@
|
||||
|
||||
import Repository
|
||||
import NamedUser
|
||||
# This allows None as a valid value for an optional parameter
|
||||
|
||||
class DefaultValueForOptionalParametersType:
|
||||
pass
|
||||
DefaultValueForOptionalParameters = DefaultValueForOptionalParametersType()
|
||||
|
||||
class Team( object ):
|
||||
def __init__( self, requester, attributes, lazy ):
|
||||
@@ -67,11 +72,11 @@ class Team( object ):
|
||||
None
|
||||
)
|
||||
|
||||
def edit( self, name, permission = None ):
|
||||
def edit( self, name, permission = DefaultValueForOptionalParameters ):
|
||||
post_parameters = {
|
||||
"name": name,
|
||||
}
|
||||
if permission is not None:
|
||||
if permission is not DefaultValueForOptionalParameters:
|
||||
post_parameters[ "permission" ] = permission
|
||||
status, headers, data = self.__requester.request(
|
||||
"PATCH",
|
||||
|
||||
Reference in New Issue
Block a user