-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug(metadata): conforms contract # to have at least the default
Updates the contract number logic and instructions on dataset editor to - add logic which prepends the LBNL contract number to the field if it does not exist already - Adds explicit intruction to the contract number field that LBNL # will be added by default and to only enter other contract numbers Closes #427
- Loading branch information
Showing
5 changed files
with
44 additions
and
8 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
archive_api/migrations/0030_alter_dataset_doe_funding_contract_numbers_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 4.2.2 on 2024-05-30 15:46 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('archive_api', '0029_alter_dataset_funding_organizations_and_more'), | ||
] | ||
|
||
def update_null_fields(apps, schema_editor): | ||
Dataset = apps.get_model('archive_api', 'dataset') | ||
for dataset in Dataset.objects.filter(doe_funding_contract_numbers=None): | ||
dataset.doe_funding_contract_numbers = 'DE-AC02-05CH11231' | ||
dataset.save() | ||
|
||
def reverse_update_null_fields(apps, schema_editor): | ||
# It is ok not to reverse | ||
pass | ||
|
||
operations = [ | ||
migrations.RunPython(update_null_fields, reverse_update_null_fields), | ||
|
||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters