mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Allow GithubObject.update() to be passed headers (#1300)
SourceImport.update() is really GithubObject.update(), which just calls GET on the object's URL. Refetching a source import requires an additional header, so change GithubObject.update() to pass any it is given, and add a test for SourceImport.update() Fixes #1297
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
################################################################################
|
||||
|
||||
from __future__ import absolute_import
|
||||
from github import Consts
|
||||
import github.GithubObject
|
||||
|
||||
|
||||
@@ -143,6 +144,10 @@ class SourceImport(github.GithubObject.CompletableGithubObject):
|
||||
self._completeIfNotSet(self._vcs_url)
|
||||
return self._vcs_url.value
|
||||
|
||||
def update(self):
|
||||
import_header = {"Accept": Consts.mediaTypeImportPreview}
|
||||
return super(SourceImport, self).update(additional_headers=import_header)
|
||||
|
||||
def _initAttributes(self):
|
||||
self._authors_count = github.GithubObject.NotSet
|
||||
self._authors_url = github.GithubObject.NotSet
|
||||
|
||||
Reference in New Issue
Block a user