Skip to content

Commit

Permalink
Merge pull request #23 from openimis/develop
Browse files Browse the repository at this point in the history
MERGING develop into release/24.10
  • Loading branch information
dragos-dobre authored Oct 2, 2024
2 parents a6e392b + f474c3a commit f095aa8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions grievance_social_protection/documents.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
from django.apps import apps
from django.conf import settings

is_unit_test_env = getattr(settings, 'IS_UNIT_TEST_ENV', False)

# Check if the 'opensearch_reports' app is in INSTALLED_APPS
if 'opensearch_reports' in apps.app_configs:
from django_opensearch_dsl import Document, fields as opensearch_fields
if 'opensearch_reports' in apps.app_configs and not is_unit_test_env:
from opensearch_reports.service import BaseSyncDocument
from django_opensearch_dsl import fields as opensearch_fields
from django_opensearch_dsl.registries import registry
from grievance_social_protection.models import Ticket

@registry.register_document
class TicketDocument(Document):
class TicketDocument(BaseSyncDocument):
DASHBOARD_NAME = 'Grievance'

key = opensearch_fields.KeywordField(),
title = opensearch_fields.KeywordField(),

Expand Down

0 comments on commit f095aa8

Please sign in to comment.