From patchwork Sun Oct 6 22:57:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Herland X-Patchwork-Id: 1172591 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46mfCs0Kjqz9sP7 for ; Mon, 7 Oct 2019 09:58:17 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=herland.net Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46mfCr69nQzDqGt for ; Mon, 7 Oct 2019 09:58:16 +1100 (AEDT) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=209.85.208.171; helo=mail-lj1-f171.google.com; envelope-from=jherland@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=herland.net Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46mfC74QJBzDq8v for ; Mon, 7 Oct 2019 09:57:35 +1100 (AEDT) Received: by mail-lj1-f171.google.com with SMTP id b20so11646368ljj.5 for ; Sun, 06 Oct 2019 15:57:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ahC159Ak8McVZTTWxCM13D6cRvYmbn4Gv1UHUIhuv3g=; b=RQBWRS1ceFkmZkkX7eIVbTYOFRQUgEUj1BxTrSLnb0+0GaXTbrrr8yGWOuERZ9lbDH AdSqrTbpg3r5xQwAMfz3nRQKZuX/ddzQxR1cOv91cWPkzjZAUxtwTyJXj9zjkfMwd8pJ M31BUNRnwqKUJGtyZApVfgyb2Z12OjK/Rq2eeFmszmanEs2bAg17ZOj7PGarxul62W+B iTURMoxILbHRPUW1DbhiL8oqrJv7uU9SwNTQVkBAN3CPDNCzi2EmJL9hg5fzatx2Kzow 3APDmoLlrDkX76AJJuCfUguw2ZaNbw/NjU3ESZNlmCUfneFamGzv6I7J5L/eUniOU54d iNrA== X-Gm-Message-State: APjAAAU58+5tY3rAlFJnd4xrk0rJ0T+Wq9l6DvFXrAJaAtanuO+tlSDq YzO7eTbr5L+mbfBuv5xUBeLZnGTA X-Google-Smtp-Source: APXvYqxc2afe/nJo4iznxhXOAxDt+ADJCAJGMd1s8fgmHDJlytyRjTE5mcXk6LXxqnRb4T63CoDf+g== X-Received: by 2002:a05:651c:1102:: with SMTP id d2mr16694616ljo.74.1570402651555; Sun, 06 Oct 2019 15:57:31 -0700 (PDT) Received: from beta.herland (160.37-191-159.fiber.lynet.no. [37.191.159.160]) by smtp.gmail.com with ESMTPSA id y13sm2732549ljd.51.2019.10.06.15.57.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Oct 2019 15:57:31 -0700 (PDT) From: Johan Herland To: patchwork@lists.ozlabs.org Subject: [PATCH 1/3] models.Event: Add the user responsible for the event Date: Mon, 7 Oct 2019 00:57:23 +0200 Message-Id: <20191006225725.5388-2-johan@herland.net> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20191006225725.5388-1-johan@herland.net> References: <20191006225725.5388-1-johan@herland.net> MIME-Version: 1.0 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mauro Carvalho Chehab Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" This allows using the events as a kind of audit log, to see how a patch came to its current state/delegate. Cc: Mauro Carvalho Chehab Signed-off-by: Johan Herland Reviewed-by: Stephen Finucane --- patchwork/migrations/0037_event_user.py | 23 +++++++++++++++++++++++ patchwork/models.py | 4 ++++ 2 files changed, 27 insertions(+) create mode 100644 patchwork/migrations/0037_event_user.py diff --git a/patchwork/migrations/0037_event_user.py b/patchwork/migrations/0037_event_user.py new file mode 100644 index 0000000..3a6e228 --- /dev/null +++ b/patchwork/migrations/0037_event_user.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.20 on 2019-09-28 21:35 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('patchwork', '0036_project_commit_url_format'), + ] + + operations = [ + migrations.AddField( + model_name='event', + name='user', + field=models.ForeignKey(blank=True, help_text=b'The user that created this event.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/patchwork/models.py b/patchwork/models.py index c198bc2..3d4e222 100644 --- a/patchwork/models.py +++ b/patchwork/models.py @@ -944,6 +944,10 @@ class Event(models.Model): date = models.DateTimeField( default=datetime.datetime.utcnow, help_text='The time this event was created.') + user = models.ForeignKey( + User, related_name='+', null=True, blank=True, + on_delete=models.SET_NULL, + help_text='The user that created this event.') # event object