Skip to content

Commit

Permalink
Suppression state propagation (#328)
Browse files Browse the repository at this point in the history

Co-authored-by: Martín Beracochea <[email protected]>
Co-authored-by: Mahfouz <[email protected]>
  • Loading branch information
3 people authored Jan 12, 2024
1 parent b626b7b commit dd827d9
Show file tree
Hide file tree
Showing 17 changed files with 498 additions and 162 deletions.
30 changes: 15 additions & 15 deletions emgapi/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,21 +463,21 @@ class AnalysisMetadataVariableNamesAdmin(admin.ModelAdmin):
]


@admin.register(emg_models.AnalysisJobAnn)
class AnalysisJobAnnAdmin(admin.ModelAdmin):
readonly_fields = [
'job',
'var',
]
list_display = [
'job',
'var'
]
search_fields = [
'job__job_id',
'var__var_name',
'var__description',
]
# @admin.register(emg_models.AnalysisJobAnn)
# class AnalysisJobAnnAdmin(admin.ModelAdmin):
# readonly_fields = [
# 'job',
# 'var',
# ]
# list_display = [
# 'job',
# 'var'
# ]
# search_fields = [
# 'job__job_id',
# 'var__var_name',
# 'var__description',
# ]


@admin.register(emg_models.CogCat)
Expand Down
2 changes: 1 addition & 1 deletion emgapi/management/commands/clean_empty_studies.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ def handle(self, *args, **kwargs):
run.ena_study_accession = study.secondary_accession
run.study = None
Run.objects.bulk_update(runs, ["ena_study_accession", "study"])
study.suppress()
study.suppress(propagate=False)
logger.info(f"{study} suppressed")
25 changes: 25 additions & 0 deletions emgapi/migrations/0013_delete_analysisjobann.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 3.2.18 on 2023-09-29 19:59

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('emgapi', '0012_alter_publication_pub_type'),
]

operations = [
# migrations.SeparateDatabaseAndState(
# state_operations=[
# migrations.RenameField(
# model_name='analysisjob',
# old_name='analysis_summary_json',
# new_name='analysis_summary',
# ),
# ],
# ),
migrations.DeleteModel(
name='AnalysisJobAnn',
),
]
44 changes: 44 additions & 0 deletions emgapi/migrations/0014_suppression_reason_ancestor_suppressed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Generated by Django 3.2.18 on 2023-09-14 07:16

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('emgapi', '0013_delete_analysisjobann'),
]

operations = [
migrations.AlterField(
model_name='analysisjob',
name='suppression_reason',
field=models.IntegerField(blank=True, choices=[(1, 'Draft'), (3, 'Cancelled'), (5, 'Suppressed'), (6, 'Killed'), (7, 'Temporary Suppressed'), (8, 'Temporary Killed'), (100, 'Ancestor Suppressed')], db_column='SUPPRESSION_REASON', null=True),
),
migrations.AlterField(
model_name='assembly',
name='study',
field=models.ForeignKey(blank=True, db_column='STUDY_ID', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='assemblies', to='emgapi.study'),
),
migrations.AlterField(
model_name='assembly',
name='suppression_reason',
field=models.IntegerField(blank=True, choices=[(1, 'Draft'), (3, 'Cancelled'), (5, 'Suppressed'), (6, 'Killed'), (7, 'Temporary Suppressed'), (8, 'Temporary Killed'), (100, 'Ancestor Suppressed')], db_column='SUPPRESSION_REASON', null=True),
),
migrations.AlterField(
model_name='run',
name='suppression_reason',
field=models.IntegerField(blank=True, choices=[(1, 'Draft'), (3, 'Cancelled'), (5, 'Suppressed'), (6, 'Killed'), (7, 'Temporary Suppressed'), (8, 'Temporary Killed'), (100, 'Ancestor Suppressed')], db_column='SUPPRESSION_REASON', null=True),
),
migrations.AlterField(
model_name='sample',
name='suppression_reason',
field=models.IntegerField(blank=True, choices=[(1, 'Draft'), (3, 'Cancelled'), (5, 'Suppressed'), (6, 'Killed'), (7, 'Temporary Suppressed'), (8, 'Temporary Killed'), (100, 'Ancestor Suppressed')], db_column='SUPPRESSION_REASON', null=True),
),
migrations.AlterField(
model_name='study',
name='suppression_reason',
field=models.IntegerField(blank=True, choices=[(1, 'Draft'), (3, 'Cancelled'), (5, 'Suppressed'), (6, 'Killed'), (7, 'Temporary Suppressed'), (8, 'Temporary Killed'), (100, 'Ancestor Suppressed')], db_column='SUPPRESSION_REASON', null=True),
),
]
Loading

0 comments on commit dd827d9

Please sign in to comment.