Ejemplo n.º 1
0
    def pre_save(self, obj):
        # task_id = self.request.QUERY_PARAMS.get('task', None)
        # task = Task.objects.get(pk=task_id)
        # obj.content_object = task

        task_type = ContentType.objects.get_for_model(Task)
        obj.content_type_id = task_type.id

        if not obj.author:
            obj.author = self.request.user
        else:
            obj.editor = self.request.user
        obj.ip_address = get_client_ip(self.request)
Ejemplo n.º 2
0
 def pre_save(self, obj):
     if not obj.author:
         obj.author = self.request.user
     else:
         obj.editor = self.request.user
     obj.ip_address = get_client_ip(self.request)
Ejemplo n.º 3
0
 def pre_save(self, obj):
     obj.author = self.request.user
     obj.ip_address = get_client_ip(self.request)