8000 Fix-up Issue Event usage of Users · pythonthings/github3.py@361824d · GitHub
[go: up one dir, main page]

Skip to content

Commit 361824d

Browse files
committed
Fix-up Issue Event usage of Users
1 parent 06c2495 commit 361824d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

github3/issues/event.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
33

4+
from .. import users
45
from ..models import GitHubCore
5-
from ..users import User
66

77

88
class IssueEvent(GitHubCore):
@@ -37,7 +37,9 @@ def _update_attributes(self, event):
3737
self.issue = self._class_attribute(event, 'issue', Issue, self)
3838

3939
#: :class:`User <github3.users.User>` who caused this event.
40-
self.actor = self._class_attribute(event, 'actor', User, self)
40+
self.actor = self._class_attribute(
41+
event, 'actor', users.ShortUser, self,
42+
)
4143

4244
#: Number of comments
4345
self.comments = self._get_attribute(event, 'comments')
@@ -55,7 +57,9 @@ def _update_attributes(self, event):
5557
self.id = self._get_attribute(event, 'id')
5658

5759
#: :class:`User <github3.users.User>` that is assigned
58-
self.assignee = self._class_attribute(event, 'assignee', User, self)
60+
self.assignee = self._class_attribute(
61+
event, 'assignee', users.ShortUser, self,
62+
)
5963

6064
#: Dictionary containing milestone details
6165
self.milestone = self._get_attribute(event, 'milestone', {})

tests/integration/test_issue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def test_events(self):
146146
issue = repository.issue(218)
147147
for event in issue.events():
148148
assert isinstance(event, github3.issues.event.IssueEvent)
149-
assert isinstance(event.actor, github3.users.User)
149+
assert isinstance(event.actor, github3.users.ShortUser)
150150

151151
def test_labels(self):
152152
"""Test the ability to iterate over issue labels."""

0 commit comments

Comments
 (0)
0