Skip to content

Commit 7c0f205

Browse files
committed
Update the owner field help text at the model level #239
Signed-off-by: tdruez <tdruez@nexb.com>
1 parent 2da3fcf commit 7c0f205

File tree

5 files changed

+44
-17
lines changed

5 files changed

+44
-17
lines changed

component_catalog/forms.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,7 @@ class Meta:
161161

162162
def __init__(self, *args, **kwargs):
163163
super().__init__(*args, **kwargs)
164-
165164
self.fields["owner"].dataspace = self.dataspace
166-
self.fields["owner"].help_text = (
167-
"Owner is the creator or maintainer of a Component, typically the current "
168-
"copyright holder. This field is optional but recommended."
169-
)
170165

171166
def clean_packages_ids(self):
172167
packages_ids = self.cleaned_data.get("packages_ids")
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Generated by Django 5.1.6 on 2025-02-18 23:07
2+
3+
import django.db.models.deletion
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('component_catalog', '0010_component_risk_score_package_risk_score'),
11+
('organization', '0001_initial'),
12+
]
13+
14+
operations = [
15+
migrations.AlterField(
16+
model_name='component',
17+
name='owner',
18+
field=models.ForeignKey(blank=True, help_text='Owner is the creator or maintainer of a component, typically the current copyright holder. This field is optional but recommended.', null=True, on_delete=django.db.models.deletion.PROTECT, to='organization.owner'),
19+
),
20+
]

component_catalog/models.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -709,17 +709,14 @@ class BaseComponentMixin(
709709
blank=True,
710710
on_delete=models.PROTECT,
711711
help_text=format_lazy(
712-
"Owner is an optional field selected by the user to identify the original "
713-
"creator (copyright holder) of the {verbose_name}. "
714-
"If this {verbose_name} is in its original, unmodified state, the {verbose_name}"
715-
" owner is associated with the original author/publisher. "
716-
"If this {verbose_name} has been copied and modified, "
717-
"the {verbose_name} owner should be the owner that has copied and "
718-
"modified it.",
712+
"Owner is the creator or maintainer of a {verbose_name}, typically the "
713+
"current copyright holder. "
714+
"This field is optional but recommended.",
719715
verbose_name=_(verbose_name),
720716
),
721717
)
722718

719+
723720
release_date = models.DateField(
724721
null=True,
725722
blank=True,

product_portfolio/forms.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,7 @@ class Meta:
147147

148148
def __init__(self, *args, **kwargs):
149149
super().__init__(*args, **kwargs)
150-
151150
self.fields["owner"].dataspace = self.dataspace
152-
self.fields["owner"].help_text = (
153-
"Owner is the creator or maintainer of a Product, typically the current "
154-
"copyright holder. This field is optional but recommended."
155-
)
156151

157152
def assign_object_perms(self, user):
158153
assign_perm("view_product", user, self.instance)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Generated by Django 5.1.6 on 2025-02-18 23:07
2+
3+
import django.db.models.deletion
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('organization', '0001_initial'),
11+
('product_portfolio', '0010_productcomponent_weighted_risk_score_and_more'),
12+
]
13+
14+
operations = [
15+
migrations.AlterField(
16+
model_name='product',
17+
name='owner',
18+
field=models.ForeignKey(blank=True, help_text='Owner is the creator or maintainer of a product, typically the current copyright holder. This field is optional but recommended.', null=True, on_delete=django.db.models.deletion.PROTECT, to='organization.owner'),
19+
),
20+
]

0 commit comments

Comments
 (0)