13
13
from uritemplate import URITemplate
14
14
15
15
from . import models
16
+ from . import users
16
17
from .decorators import requires_auth
17
18
from .issues import Issue
18
19
from .issues .comment import IssueComment
19
20
from .repos .commit import RepoCommit
20
21
from .repos .contents import Contents
21
- from .users import User
22
22
23
23
24
24
class PullDestination (models .GitHubCore ):
@@ -39,7 +39,7 @@ def __init__(self, dest, direction):
39
39
#: :class:`User <github3.users.User>` representing the owner
40
40
self .user = None
41
41
if dest .get ('user' ):
42
- self .user = User (dest .get ('user' ), None )
42
+ self .user = users . ShortUser (dest .get ('user' ), None )
43
43
#: SHA of the commit at the head
44
44
self .sha = dest .get ('sha' )
45
45
self ._repo_name = ''
@@ -198,7 +198,9 @@ def _update_attributes(self, pull):
198
198
self .mergeable_state = self ._get_attribute (pull , 'mergeable_state' )
199
199
200
200
#: :class:`User <github3.users.User>` who merged this pull
201
- self .merged_by = self ._class_attribute (pull , 'merged_by' , User , self )
201
+ self .merged_by = self ._class_attribute (
202
+ pull , 'merged_by' , users .ShortUser , self ,
203
+ )
202
204
203
205
#: Number of the pull/issue on the repository
204
206
self .number = self ._get_attribute (pull , 'number' )
@@ -237,11 +239,13 @@ def _update_attributes(self, pull):
237
239
238
240
#: :class:`User <github3.users.User>` object representing the creator
239
241
#: of the pull request
240
- self .user = self ._class_attribute (pull , 'user' , User , self )
242
+ self .user = self ._class_attribute (pull , 'user' , users . ShortUser , self )
241
243
242
244
#: :class:`User <github3.users.User>` object representing the assignee
243
245
#: of the pull request
244
- self .assignee = self ._class_attribute (pull , 'assignee' , User , self )
246
+ self .assignee = self ._class_attribute (
247
+ pull , 'assignee' , users .ShortUser , self ,
248
+ )
245
249
246
250
def _repr (self ):
247
251
return '<Pull Request [#{0}]>' .format (self .number )
@@ -460,7 +464,9 @@ def _update_attributes(self, preview):
460
464
self .commit_id = self ._get_attribute (preview , 'commit_id' )
461
465
462
466
#: :class:`User <github3.users.User>` who made the comment
463
- self .user = self ._class_attribute (preview , 'user' , User , self )
467
+ self .user = self ._class_attribute (
468
+ preview , 'user' , users .ShortUser , self ,
469
+ )
464
470
465
471
#: State of the review
466
472
self .state = self ._get_attribute (preview , 'state' )
@@ -502,7 +508,9 @@ class ReviewComment(models.BaseComment):
502
508
def _update_attributes (self , comment ):
503
509
super (ReviewComment , self )._update_attributes (comment )
504
510
#: :class:`User <github3.users.User>` who made the comment
505
- self .user = self ._class_attribute (comment , 'user' , User , self )
511
+ self .user = self ._class_attribute (
512
+ comment , 'user' , users .ShortUser , self ,
513
+ )
506
514
507
515
#: Original position inside the file
508
516
self .original_position = self ._get_attribute (
0 commit comments