本文整理汇总了Python中sentry.models.Group.from_share_id方法的典型用法代码示例。如果您正苦于以下问题:Python Group.from_share_id方法的具体用法?Python Group.from_share_id怎么用?Python Group.from_share_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sentry.models.Group
的用法示例。
在下文中一共展示了Group.from_share_id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from sentry.models import Group [as 别名]
# 或者: from sentry.models.Group import from_share_id [as 别名]
def get(self, request, share_id):
"""
Retrieve an aggregate
Return details on an individual aggregate specified by it's shared ID.
{method} {path}
Note: This is not the equivilant of what you'd receive with the standard
group details endpoint. Data is more restrictive and designed
specifically for sharing.
"""
try:
group = Group.from_share_id(share_id)
except Group.DoesNotExist:
raise ResourceDoesNotExist
if group.organization.flags.disable_shared_issues:
raise ResourceDoesNotExist
event = group.get_latest_event()
context = serialize(group, request.user, SharedGroupSerializer())
context['latestEvent'] = serialize(event, request.user, SharedEventSerializer())
# TODO(dcramer): use specific serializer for public group and embed
# event details as part of api response
return Response(context)
示例2: get
# 需要导入模块: from sentry.models import Group [as 别名]
# 或者: from sentry.models.Group import from_share_id [as 别名]
def get(self, request):
"""
Retrieve an aggregate
Return details on an individual aggregate specified by query parameters.
{method} {path}?shareId=mnIX
"""
share_id = request.GET.get('shareId')
if share_id:
try:
group = Group.from_share_id(share_id)
except Group.DoesNotExist:
group = None
else:
group = None
if not group:
return Response({'detail': 'No groups found'}, status=404)
return client.get('/groups/{}/'.format(group.id), request.user, request.auth)
示例3: test_invalid_shared_id
# 需要导入模块: from sentry.models import Group [as 别名]
# 或者: from sentry.models.Group import from_share_id [as 别名]
def test_invalid_shared_id(self):
with pytest.raises(Group.DoesNotExist):
Group.from_share_id('adc7a5b902184ce3818046302e94f8ec')