• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python permissions.can_admin_group函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中sentry.permissions.can_admin_group函数的典型用法代码示例。如果您正苦于以下问题:Python can_admin_group函数的具体用法?Python can_admin_group怎么用?Python can_admin_group使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了can_admin_group函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: get_view_response

    def get_view_response(self, request, group):
        from sentry.models import Event
        from sentry.permissions import can_admin_group

        self.selected = request.path == self.get_url(group)

        if not self.selected:
            return

        response = self.view(request, group)

        if not response:
            return

        if isinstance(response, HttpResponseRedirect):
            return response

        if not isinstance(response, Response):
            raise NotImplementedError("Use self.render() when returning responses.")

        event = group.get_latest_event() or Event()
        event.group = group

        return response.respond(
            request,
            {
                "plugin": self,
                "project": group.project,
                "group": group,
                "event": event,
                "can_admin_event": can_admin_group(request.user, group),
            },
        )
开发者ID:beyondtime,项目名称:sentry,代码行数:33,代码来源:base.py


示例2: get_view_response

    def get_view_response(self, request, group):
        from sentry.permissions import can_admin_group

        self.selected = request.path == self.get_url(group)

        if not self.selected:
            return

        response = self.view(request, group)

        if not response:
            return

        if isinstance(response, HttpResponseRedirect):
            return response

        if not isinstance(response, Response):
            raise NotImplementedError('Please use self.render() when returning responses.')

        return response.respond(request, {
            'plugin': self,
            'project': group.project,
            'group': group,
            'can_admin_event': can_admin_group(request.user, group),
        })
开发者ID:abossard,项目名称:sentry,代码行数:25,代码来源:base.py


示例3: group_event_details

def group_event_details(request, project, group, event_id):
    event = get_object_or_404(group.event_set, id=event_id)

    base_qs = group.event_set.exclude(id=event_id)
    try:
        next_event = base_qs.filter(datetime__gte=event.datetime).order_by('datetime')[0:1].get()
    except Event.DoesNotExist:
        next_event = None

    try:
        prev_event = base_qs.filter(datetime__lte=event.datetime).order_by('-datetime')[0:1].get()
    except Event.DoesNotExist:
        prev_event = None

    return render_to_response('sentry/groups/event.html', {
        'project': project,
        'page': 'event',
        'group': group,
        'event': event,
        'next_event': next_event,
        'prev_event': prev_event,
        'json_data': event.data.get('extra', {}),
        'version_data': event.data.get('modules', None),
        'can_admin_event': can_admin_group(request.user, group),
    }, request)
开发者ID:MSylvia,项目名称:sentry,代码行数:25,代码来源:groups.py


示例4: group_event_list

def group_event_list(request, project, group):
    event_list = group.event_set.all().order_by('-datetime')

    return render_to_response('sentry/groups/event_list.html', {
        'project': project,
        'group': group,
        'event_list': event_list,
        'page': 'event_list',
        'can_admin_event': can_admin_group(request.user, group),
    }, request)
开发者ID:acdha,项目名称:sentry,代码行数:10,代码来源:groups.py


示例5: group_tag_details

def group_tag_details(request, project, group, tag_name):
    return render_to_response('sentry/plugins/bases/tag/index.html', {
        'project': project,
        'group': group,
        'title': tag_name.replace('_', ' ').title(),
        'tag_name': tag_name,
        'unique_tags': group.get_unique_tags(tag_name),
        'group': group,
        'page': 'tag_details',
        'can_admin_event': can_admin_group(request.user, group),
    }, request)
开发者ID:acdha,项目名称:sentry,代码行数:11,代码来源:groups.py


示例6: group_event_details

def group_event_details(request, project, group, event_id):
    event = get_object_or_404(group.event_set, pk=event_id)

    return render_to_response('sentry/groups/event.html', {
        'project': project,
        'page': 'event',
        'group': group,
        'event': event,
        'json_data': event.data.get('extra', {}),
        'version_data': event.data.get('modules', None),
        'can_admin_event': can_admin_group(request.user, group),
    }, request)
开发者ID:allanlei,项目名称:sentry,代码行数:12,代码来源:groups.py


示例7: render_with_group_context

def render_with_group_context(group, template, context, request=None,
                              event=None, is_public=False):
    context.update({
        'team': group.project.team,
        'organization': group.project.organization,
        'project': group.project,
        'group': group,
        'can_admin_event': can_admin_group(request.user, group),
        'can_remove_event': can_remove_group(request.user, group),
    })

    if event:
        if event.id:
            # TODO(dcramer): we dont want to actually use gt/lt here as it should
            # be inclusive. However, that would need to ensure we have some kind
            # of way to know which event was the previous (an offset), or to add
            # a third sort key (which is not yet indexed)
            base_qs = group.event_set.exclude(id=event.id)
            try:
                next_event = base_qs.filter(
                    datetime__gt=event.datetime,
                ).order_by('datetime','id')[0:1].get()
            except Event.DoesNotExist:
                next_event = None

            try:
                prev_event = base_qs.filter(
                    datetime__lt=event.datetime,
                ).order_by('-datetime','-id')[0:1].get()
            except Event.DoesNotExist:
                prev_event = None
        else:
            next_event = None
            prev_event = None

        if not is_public:
            extra_data = event.data.get('extra', {})
            if not isinstance(extra_data, dict):
                extra_data = {}

            context.update({
                'tags': event.get_tags(),
                'json_data': extra_data,
            })

        context.update({
            'event': event,
            'version_data': event.data.get('modules', None),
            'next_event': next_event,
            'prev_event': prev_event,
        })

    return render_to_response(template, context, request)
开发者ID:uber,项目名称:sentry,代码行数:53,代码来源:groups.py


示例8: group_event_list

def group_event_list(request, project, group):
    event_list = group.event_set.all().order_by("-datetime")

    return render_to_response(
        "sentry/groups/event_list.html",
        {
            "project": project,
            "group": group,
            "event_list": event_list,
            "page": "event_list",
            "can_admin_event": can_admin_group(request.user, group),
        },
        request,
    )
开发者ID:davidszotten,项目名称:sentry,代码行数:14,代码来源:groups.py


示例9: group

def group(request, project, group):
    # It's possible that a message would not be created under certain
    # circumstances (such as a post_save signal failing)
    event = group.get_latest_event() or Event(group=group)

    return render_to_response('sentry/groups/details.html', {
        'project': project,
        'page': 'details',
        'group': group,
        'event': event,
        'interface_list': _get_rendered_interfaces(event),
        'json_data': event.data.get('extra', {}),
        'version_data': event.data.get('modules', None),
        'can_admin_event': can_admin_group(request.user, group),
    }, request)
开发者ID:acdha,项目名称:sentry,代码行数:15,代码来源:groups.py


示例10: group_tag_details

def group_tag_details(request, project, group, tag_name):
    return render_to_response(
        "sentry/plugins/bases/tag/index.html",
        {
            "project": project,
            "group": group,
            "title": tag_name.replace("_", " ").title(),
            "tag_name": tag_name,
            "unique_tags": group.get_unique_tags(tag_name),
            "group": group,
            "page": "tag_details",
            "can_admin_event": can_admin_group(request.user, group),
        },
        request,
    )
开发者ID:davidszotten,项目名称:sentry,代码行数:15,代码来源:groups.py


示例11: render_with_group_context

def render_with_group_context(group, template, context, request=None):
    # It's possible that a message would not be created under certain
    # circumstances (such as a post_save signal failing)
    event = group.get_latest_event() or Event()
    event.group = group

    context.update({
        'project': group.project,
        'group': group,
        'event': event,
        'json_data': event.data.get('extra', {}),
        'version_data': event.data.get('modules', None),
        'can_admin_event': can_admin_group(request.user, group),
    })

    return render_to_response(template, context, request)
开发者ID:MSylvia,项目名称:sentry,代码行数:16,代码来源:groups.py


示例12: group_event_details

def group_event_details(request, project, group, event_id):
    event = get_object_or_404(group.event_set, pk=event_id)

    return render_to_response(
        "sentry/groups/event.html",
        {
            "project": project,
            "page": "event_list",
            "group": group,
            "event": event,
            "interface_list": _get_rendered_interfaces(event),
            "json_data": event.data.get("extra", {}),
            "version_data": event.data.get("modules", None),
            "can_admin_event": can_admin_group(request.user, group),
        },
        request,
    )
开发者ID:davidszotten,项目名称:sentry,代码行数:17,代码来源:groups.py


示例13: render_with_group_context

def render_with_group_context(group, template, context, request=None,
                              event=None, is_public=False):
    context.update({
        'team': group.project.team,
        'organization': group.project.organization,
        'project': group.project,
        'group': group,
        'can_admin_event': can_admin_group(request.user, group),
        'can_remove_event': can_remove_group(request.user, group),
    })

    if event:
        if event.id:
            base_qs = group.event_set.exclude(id=event.id)
            try:
                next_event = base_qs.filter(datetime__gte=event.datetime).order_by('datetime')[0:1].get()
            except Event.DoesNotExist:
                next_event = None

            try:
                prev_event = base_qs.filter(datetime__lte=event.datetime).order_by('-datetime')[0:1].get()
            except Event.DoesNotExist:
                prev_event = None
        else:
            next_event = None
            prev_event = None

        if not is_public:
            extra_data = event.data.get('extra', {})
            if not isinstance(extra_data, dict):
                extra_data = {}

            context.update({
                'tags': event.get_tags(),
                'json_data': extra_data,
            })

        context.update({
            'event': event,
            'version_data': event.data.get('modules', None),
            'next_event': next_event,
            'prev_event': prev_event,
        })

    return render_to_response(template, context, request)
开发者ID:galdwulf,项目名称:sentry,代码行数:45,代码来源:groups.py


示例14: render_with_group_context

def render_with_group_context(group, template, context, request=None, event=None, is_public=False):
    context.update(
        {
            "team": group.project.team,
            "project": group.project,
            "group": group,
            "can_admin_event": can_admin_group(request.user, group),
        }
    )

    if event:
        if event.id:
            base_qs = group.event_set.exclude(id=event.id)
            try:
                next_event = base_qs.filter(datetime__gte=event.datetime).order_by("datetime")[0:1].get()
            except Event.DoesNotExist:
                next_event = None

            try:
                prev_event = base_qs.filter(datetime__lte=event.datetime).order_by("-datetime")[0:1].get()
            except Event.DoesNotExist:
                prev_event = None
        else:
            next_event = None
            prev_event = None

        if not is_public:
            extra_data = event.data.get("extra", {})
            if not isinstance(extra_data, dict):
                extra_data = {}

            context.update({"tags": event.get_tags(), "json_data": extra_data})

        context.update(
            {
                "event": event,
                "version_data": event.data.get("modules", None),
                "next_event": next_event,
                "prev_event": prev_event,
            }
        )

    return render_to_response(template, context, request)
开发者ID:Getsidecar,项目名称:sentry,代码行数:43,代码来源:groups.py


示例15: render_with_group_context

def render_with_group_context(group, template, context, request=None, event=None):
    activity = Activity.objects.filter(
        group=group,
    ).order_by('-datetime').select_related('user')
    if event:
        activity = activity.filter(Q(event__isnull=True) | Q(event=event))

    activity = list(activity)

    context.update({
        'team': group.project.team,
        'project': group.project,
        'group': group,
        'can_admin_event': can_admin_group(request.user, group),
        'SECTION': 'events',
        'activity': activity,
    })

    if event:
        if event.id:
            base_qs = group.event_set.exclude(id=event.id)
            try:
                next_event = base_qs.filter(datetime__gte=event.datetime).order_by('datetime')[0:1].get()
            except Event.DoesNotExist:
                next_event = None

            try:
                prev_event = base_qs.filter(datetime__lte=event.datetime).order_by('-datetime')[0:1].get()
            except Event.DoesNotExist:
                prev_event = None
        else:
            next_event = None
            prev_event = None

        context.update({
            'event': event,
            'json_data': event.data.get('extra', {}),
            'version_data': event.data.get('modules', None),
            'next_event': next_event,
            'prev_event': prev_event,
        })

    return render_to_response(template, context, request)
开发者ID:surflightroy,项目名称:sentry,代码行数:43,代码来源:groups.py


示例16: group

def group(request, project, group):
    # It's possible that a message would not be created under certain
    # circumstances (such as a post_save signal failing)
    event = group.get_latest_event() or Event(group=group)

    return render_to_response(
        "sentry/groups/details.html",
        {
            "project": project,
            "page": "details",
            "group": group,
            "event": event,
            "interface_list": _get_rendered_interfaces(event),
            "json_data": event.data.get("extra", {}),
            "version_data": event.data.get("modules", None),
            "can_admin_event": can_admin_group(request.user, group),
        },
        request,
    )
开发者ID:davidszotten,项目名称:sentry,代码行数:19,代码来源:groups.py



注:本文中的sentry.permissions.can_admin_group函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python permissions.can_create_projects函数代码示例发布时间:2022-05-27
下一篇:
Python options.set函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap