Commit 8916cd93 authored by Open Science Conservation Fund's avatar Open Science Conservation Fund
Browse files

fixed feedback mechanism and some issues reported by the coderabbit review

parent bc0193c9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
<p align="center">
  <img src="trapper/trapper-project/trapper/apps/common/static/images/logo/logo_text.png">
  <img src="trapper/trapper-project/trapper/apps/common/static/images/logo/logo_text.png" alt="TRAPPER Logo">
</p>

<div align="center"> 
+4 −4
Original line number Diff line number Diff line
@@ -2309,7 +2309,7 @@ msgstr "Wskazuje rekordy, które są częścią procesu konfiguracji kamery"

#: trapper/apps/media_classification/forms.py:542
msgid "Sex of individuals (list): Male/Female/Undefined"
msgstr "Płeć osób (lista): mężczyzna/kobieta/niezdefiniowane"
msgstr "Płeć osób (lista): samiec/samica/niezdefiniowana"

#: trapper/apps/media_classification/forms.py:548
msgid "Age of individuals (list): Adult/Juvenile/Undefined"
@@ -3457,7 +3457,7 @@ msgstr "Młody"

#: trapper/apps/media_classification/taxonomy.py:38
msgid "Juvenile"
msgstr "Nieletni"
msgstr "Młodociany"

#: trapper/apps/media_classification/taxonomy.py:39
msgid "Offspring"
@@ -3465,11 +3465,11 @@ msgstr "Potomstwo"

#: trapper/apps/media_classification/taxonomy.py:58
msgid "Female"
msgstr "Kobieta"
msgstr "Samica"

#: trapper/apps/media_classification/taxonomy.py:59
msgid "Male"
msgstr "Mężczyzna"
msgstr "Samiec"

#: trapper/apps/media_classification/taxonomy.py:73
msgid "Undefined"
+0 −20
Original line number Diff line number Diff line
# Generated by Django 4.2.17 on 2025-11-03 12:56

import django.core.files.storage
from django.db import migrations, models
import trapper.apps.accounts.models


class Migration(migrations.Migration):

    dependencies = [
        ('accounts', '0030_alter_userhttpuploaderaccountfiles_file_size'),
    ]

    operations = [
        migrations.AlterField(
            model_name='userhttpuploaderaccountfiles',
            name='file',
            field=models.FileField(storage=django.core.files.storage.FileSystemStorage(location='/home/kbubnicki/Devel/trapper-ecosystem/trapper/trapper/external_media'), upload_to=trapper.apps.accounts.models.user_http_uploader_file_path),
        ),
    ]
+6 −4
Original line number Diff line number Diff line
@@ -186,7 +186,10 @@ class CSClassificationFilter(ClassificationFilter):

    def get_is_classified_by_me(self, qs, name, value):
        filter_args = dict(
            child_classifications__classification_type=ClassificationType.USER,
            child_classifications__classification_type__in=[
                ClassificationType.USER,
                ClassificationType.FEEDBACK,
            ],
            child_classifications__owner=self.request.user,
        )
        return (
@@ -199,9 +202,8 @@ class CSClassificationFilter(ClassificationFilter):

    def get_has_feedback(self, qs, name, value):
        filter_args = dict(
            classification_type=ClassificationType.USER,
            owner=self.request.user,
            is_feedback=True,
            child_classifications__classification_type=ClassificationType.FEEDBACK,
            child_classifications__owner=self.request.user,
        )
        return (
            qs.filter(**filter_args) if str2bool(value) else qs.exclude(**filter_args)
+9 −0
Original line number Diff line number Diff line
@@ -786,6 +786,15 @@ class CSProjectMediaSerializer(serializers.ModelSerializer):
                self.dynamic_attrs = cls.dynamic_attrs.all()
                self.bboxes_msgpack = cls.get_msgpack_url()

        # User FEEDBACK classification exists
        elif (
            own_classification
            and own_classification.classification_type == ClassificationType.FEEDBACK
        ):
            cls = own_classification
            self.dynamic_attrs = cls.dynamic_attrs.all()
            self.bboxes_msgpack = cls.get_msgpack_url()

        # Approved FINAL classification exists
        else:
            self.dynamic_attrs = (
Loading