Ejemplo n.º 1
0
    def post_delete(self, sender, document, **kwargs):
        """
        Post delete hook handler

        - De-index group from elasticsearch
        """
        es_document_deindex.delay(document)
Ejemplo n.º 2
0
    def post_delete(self, sender, document, **kwargs):
        """
        Post delete hook handler

        - De-index group from elasticsearch
        """
        es_document_deindex.delay(document)
Ejemplo n.º 3
0
    def post_delete(self, sender, document, **kwargs):
        """
        Post save hook handler

        - De-index item from elasticsearch
        """
        # De-index item from elasticsearch
        es_document_deindex.delay(document)
Ejemplo n.º 4
0
    def post_delete(self, sender, document, **kwargs):
        """
        Post save hook handler

        - De-index item from elasticsearch
        """
        # De-index item from elasticsearch
        es_document_deindex.delay(document)
Ejemplo n.º 5
0
    def post_delete(self, sender, document, **kwargs):
        """
        Post delete hook handler

        - Deletes related photo, if exists
        - De-index entity from elasticsearch
        """
        # Deletes related photo, if exists
        if document.photo:
            document.photo.delete()

        # De-index entity from elasticsearch
        es_document_deindex.delay(document)
Ejemplo n.º 6
0
    def post_delete(self, sender, document, **kwargs):
        """
        Post delete hook handler

        - Deletes related attachments, if exists
        - De-index invoice based document from elasticsearch
        - Removes timeline and notification entries
        """
        # Deletes related attachments, if exists
        for attachment in document.attachments:
            attachment.delete()

        # De-index invoice based document from elasticsearch
        es_document_deindex.delay(document)

        # Removes timeline and notification entries
        invoicebase_deleted_task.delay(document)
Ejemplo n.º 7
0
    def post_delete(self, sender, document, **kwargs):
        """
        Post delete hook handler

        - Deletes related attachments, if exists
        - De-index invoice based document from elasticsearch
        - Removes timeline and notification entries
        """
        # Deletes related attachments, if exists
        for attachment in document.attachments:
            attachment.delete()

        # De-index invoice based document from elasticsearch
        es_document_deindex.delay(document)

        # Removes timeline and notification entries
        invoicebase_deleted_task.delay(document)
Ejemplo n.º 8
0
    def post_delete(self, sender, document, **kwargs):
        """
        Post delete hook handler

        - Removes the django user from the django group
        - De-index user from elasticsearch
        """
        from django.contrib.auth.models import Group
        UserModel = get_user_model()

        # Removes the django user from the django group
        user = UserModel._default_manager.get(email=document.email)
        group = Group.objects.get(name=document.tenant.slug)
        group.user_set.remove(user)
        group.save()

        # De-index document from Elastic Search
        es_document_deindex.delay(document)
Ejemplo n.º 9
0
    def post_delete(self, sender, document, **kwargs):
        """
        Post delete hook handler

        - Removes the django user from the django group
        - De-index user from elasticsearch
        """
        from django.contrib.auth.models import Group
        UserModel = get_user_model()

        # Removes the django user from the django group
        user = UserModel._default_manager.get(email=document.email)
        group = Group.objects.get(name=document.tenant.slug)
        group.user_set.remove(user)
        group.save()

        # De-index document from Elastic Search
        es_document_deindex.delay(document)