Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit361824d

Browse files
committed
Fix-up Issue Event usage of Users
1 parent06c2495 commit361824d

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__importunicode_literals
33

4+
from ..importusers
45
from ..modelsimportGitHubCore
5-
from ..usersimportUser
66

77

88
classIssueEvent(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
foreventinissue.events():
148148
assertisinstance(event,github3.issues.event.IssueEvent)
149-
assertisinstance(event.actor,github3.users.User)
149+
assertisinstance(event.actor,github3.users.ShortUser)
150150

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp