Skip to content

Commit

Permalink
fix flake linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-VM committed Feb 6, 2025
1 parent 41c1153 commit 9c0de12
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion core/api/utils/metadata_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def store_metadata_values(s_data, schema_obj, analysis_date):
"value": value,
"sample": sample_obj.id,
"schema_property": property_name.id,
"analysis_date": analysis_date, # FIXME: allowed format is: YYYY-MM-DD. Add "Not provided" value too
"analysis_date": analysis_date, # FIXME: allowed format is: YYYY-MM-DD. Add "Not provided" value too
}
except AttributeError:
return {
Expand Down
4 changes: 2 additions & 2 deletions core/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
@api_view(["POST"])
@permission_classes([IsAuthenticated])
# FIXME: When input data has not ENA value, it returns 404, but samples were successfully added to database.
# - Proposal: emit a warning message instead
# - Proposal: emit a warning message instead
def create_sample_data(request):
if request.method == "POST":
data = request.data
Expand Down Expand Up @@ -441,7 +441,7 @@ def create_metadata_value(request):
{"ERROR": core.config.ERROR_ANALYSIS_ALREADY_DEFINED},
status=status.HTTP_400_BAD_REQUEST,
)
# FIXME: 'analysis_date' create errors when it is none. A custom serializer that allows both specific date format and "not-provided" value should be added.
# FIXME: 'analysis_date' create errors when it is none. A custom serializer that allows both specific date format and "not-provided" value should be added.
stored_data = core.api.utils.metadata_values.store_metadata_values(
data, schema_obj, analysis_date
)
Expand Down
1 change: 1 addition & 0 deletions core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ def get_lineage_name(self):
def get_lineage_id(self):
return "%s" % (self.pk)


# FIXME: Lineage tables should be removed in #181
class LineageFieldsManager(models.Manager):
def create_new_field(self, data):
Expand Down
6 changes: 3 additions & 3 deletions core/utils/bioinfo_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import core.models
import core.utils.samples
import core.utils.schema
from django.db.models import Max, F, Subquery, OuterRef
from django.db.models import Max, Subquery, OuterRef


def get_bio_analysis_stats_from_lab(lab_name=None):
"""Get the number of samples that are analized and compare with the number
Expand All @@ -27,6 +28,7 @@ def get_bio_analysis_stats_from_lab(lab_name=None):
bio_stats["received"] = len(sample_objs)
return bio_stats


def get_bioinfo_analysis_data_from_sample(sample_id):
"""Get the latest bioinfo analysis data for the sample, ensuring unique values"""

Expand Down Expand Up @@ -80,11 +82,9 @@ def get_bioinfo_analysis_data_from_sample(sample_id):
bio_field.schema_property.get_label(),
value
])

return bio_anlys_data



# FIXME: Replace BioinfoAnalysisField wit MetadataValue
# TODO: I think this function belongs to dashboard app
def get_bioinfo_analyis_fields_utilization(schema_obj=None):
Expand Down
2 changes: 1 addition & 1 deletion core/utils/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def get_lab_last_actions(lab_name=None):
if core.models.SampleStateHistory.objects.filter(sample=sam_obj, state__state__exact=action).exist():
lab_data.append(
core.models.SampleStateHistory.objects.filter(
sample=sam_obj,
sample=sam_obj,
state__state__exact=action
)
.last()
Expand Down
2 changes: 1 addition & 1 deletion core/utils/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def store_schema_properties(schema_obj, s_properties, required):
)
except (KeyError, DataError) as e:
print(prop_key, " error ", e)
return {"ERROR": e }
return {"ERROR": e}
# schema_obj.delete()
if "options" in data:
for item in s_properties[prop_key]["enum"]:
Expand Down
1 change: 1 addition & 0 deletions core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def search_sample(request):
)
return render(request, "core/searchSample.html", {"search_data": search_data})


# FIXME: This needs a template or error message when user != admin tryies to access.
@login_required
def metadata_visualization(request):
Expand Down

0 comments on commit 9c0de12

Please sign in to comment.