diff --git a/enterprise_subsidy/apps/api/v1/views/transaction.py b/enterprise_subsidy/apps/api/v1/views/transaction.py index b14b67c1..ecfb217c 100644 --- a/enterprise_subsidy/apps/api/v1/views/transaction.py +++ b/enterprise_subsidy/apps/api/v1/views/transaction.py @@ -217,7 +217,10 @@ def base_queryset(self): for learner_only_context in learner_only_contexts: # For each context (enterprise_customer_uuid) that the requester only has learner access to, filter # transactions related to that context to only include their own transactions. - # pylint: disable=unsupported-binary-operation + # AED 2023-10-31: locally, pylint complains of the binary operation. + # In github actions, pylint complains of a useless-suppression. + # Suppressing both and letting the code gods sort it out. + # pylint: disable=unsupported-binary-operation,useless-suppression if request_jwt.get('user_id'): queryset = queryset.filter( ( diff --git a/enterprise_subsidy/apps/subsidy/migrations/0019_alter_historicalsubsidy_options.py b/enterprise_subsidy/apps/subsidy/migrations/0019_alter_historicalsubsidy_options.py new file mode 100644 index 00000000..fb48272b --- /dev/null +++ b/enterprise_subsidy/apps/subsidy/migrations/0019_alter_historicalsubsidy_options.py @@ -0,0 +1,17 @@ +# Generated by Django 3.2.19 on 2023-10-31 13:02 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('subsidy', '0018_alter_historicalsubsidy_options'), + ] + + operations = [ + migrations.AlterModelOptions( + name='historicalsubsidy', + options={'get_latest_by': 'history_date', 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical subsidy'}, + ), + ] diff --git a/enterprise_subsidy/apps/subsidy/migrations/0020_remove_subsidy_unique_reference_id_non_internal.py b/enterprise_subsidy/apps/subsidy/migrations/0020_remove_subsidy_unique_reference_id_non_internal.py new file mode 100644 index 00000000..fe4d43c0 --- /dev/null +++ b/enterprise_subsidy/apps/subsidy/migrations/0020_remove_subsidy_unique_reference_id_non_internal.py @@ -0,0 +1,17 @@ +# Generated by Django 3.2.19 on 2023-10-31 13:04 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('subsidy', '0019_alter_historicalsubsidy_options'), + ] + + operations = [ + migrations.RemoveConstraint( + model_name='subsidy', + name='unique_reference_id_non_internal', + ), + ] diff --git a/enterprise_subsidy/apps/subsidy/models.py b/enterprise_subsidy/apps/subsidy/models.py index 211c5c44..d922f268 100644 --- a/enterprise_subsidy/apps/subsidy/models.py +++ b/enterprise_subsidy/apps/subsidy/models.py @@ -14,7 +14,6 @@ from uuid import uuid4 from django.db import models -from django.db.models import Q from django.utils.functional import cached_property from edx_rbac.models import UserRole, UserRoleAssignment from edx_rbac.utils import ALL_ACCESS_CONTEXT @@ -104,13 +103,6 @@ class Meta: """ Metaclass for Subsidy. """ - constraints = [ - models.UniqueConstraint( - condition=Q(internal_only=False), # Allow more flexibility for internal/test subsidies. - fields=["reference_id", "reference_type"], - name="unique_reference_id_non_internal", - ) - ] ordering = ['-created'] # Please reserve the "subsidy_type" field name for the future when we use it to distinguish between