示例#1
0
文件: version.py 项目: reshama/editor
    def post(self, request, *args, **kwargs):
        version = self.get_object()
        revision = version.revision

        if not (request.user == revision.user or request.user.is_superuser):
            return http.HttpResponseForbidden('You don\'t have the necessary access rights.')

        if not version.revision.comment:
            notify_watching(request.user,verb='made changes to',target=version.object)

        version.revision.comment = request.POST['comment']

        version.revision.save()

        return http.HttpResponse('ok', content_type='text/plain')
示例#2
0
    def post(self, request, *args, **kwargs):
        version = self.get_object()
        revision = version.revision

        if not (request.user == revision.user or request.user.is_superuser):
            return http.HttpResponseForbidden(
                'You don\'t have the necessary access rights.')

        if not version.revision.comment:
            notify_watching(request.user,
                            verb='made changes to',
                            target=version.object)

        version.revision.comment = request.POST['comment']

        version.revision.save()

        return http.HttpResponse('ok', content_type='text/plain')
示例#3
0
文件: models.py 项目: reshama/editor
def notify_comment(instance,**kwargs):
    notify_watching(instance.user,target=instance.object,verb='commented on',action_object=instance)
示例#4
0
文件: models.py 项目: reshama/editor
def notify_stamp(instance,**kwargs):
    notify_watching(instance.user,target=instance.object,verb='gave feedback on',action_object=instance)
示例#5
0
def notify_comment(instance, **kwargs):
    notify_watching(instance.user,
                    target=instance.object,
                    verb='commented on',
                    action_object=instance)
示例#6
0
def notify_stamp(instance, **kwargs):
    notify_watching(instance.user,
                    target=instance.object,
                    verb='gave feedback on',
                    action_object=instance)