From a7c455cc054eb88b74d27d7cc3ce297770f18fd0 Mon Sep 17 00:00:00 2001 From: Alex Manning Date: Mon, 29 Jul 2024 15:41:40 +0100 Subject: [PATCH] Add internal comment fields to jasmin_services grants and requests. --- .../0025_add_internal_comment_fields.py | 24 +++++++++++++++++++ jasmin_services/models/grant.py | 3 +++ jasmin_services/models/request.py | 3 +++ 3 files changed, 30 insertions(+) create mode 100644 jasmin_services/migrations/0025_add_internal_comment_fields.py diff --git a/jasmin_services/migrations/0025_add_internal_comment_fields.py b/jasmin_services/migrations/0025_add_internal_comment_fields.py new file mode 100644 index 0000000..4ec2a7e --- /dev/null +++ b/jasmin_services/migrations/0025_add_internal_comment_fields.py @@ -0,0 +1,24 @@ +# Generated by Django 5.0.7 on 2024-07-29 14:40 + +import django_countries.fields +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("jasmin_services", "0024_grant_revoked_at_alter_behaviour_polymorphic_ctype"), + ] + + operations = [ + migrations.AddField( + model_name="grant", + name="internal_comment", + field=models.TextField(blank=True, verbose_name="Internal nodes"), + ), + migrations.AddField( + model_name="request", + name="internal_comment", + field=models.TextField(blank=True, verbose_name="Internal nodes"), + ), + ] diff --git a/jasmin_services/models/grant.py b/jasmin_services/models/grant.py index 2c58011..72a048a 100644 --- a/jasmin_services/models/grant.py +++ b/jasmin_services/models/grant.py @@ -133,6 +133,9 @@ class Meta: "self", models.SET_NULL, null=True, blank=True, related_name="next_grant" ) + # Add a field for an internal comment about the grant. + internal_comment = models.TextField(blank=True, verbose_name="Internal nodes") + @property def user(self): return self.access.user diff --git a/jasmin_services/models/request.py b/jasmin_services/models/request.py index 2cc3fa5..84ee1f1 100644 --- a/jasmin_services/models/request.py +++ b/jasmin_services/models/request.py @@ -168,6 +168,9 @@ class Meta: help_text=markdown_allowed(), ) + # Add a field for an internal comment about the grant. + internal_comment = models.TextField(blank=True, verbose_name="Internal nodes") + def __str__(self): return "{} : {}".format(self.access, "INCOMPETE" if self.incomplete else self.state)