master #316
@ -9,4 +9,4 @@ Created on: 19.10.21
 | 
				
			|||||||
# Defines the date of the legal publishing of the LKompVzVo
 | 
					# Defines the date of the legal publishing of the LKompVzVo
 | 
				
			||||||
from django.utils import timezone
 | 
					from django.utils import timezone
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LKOMPVZVO_PUBLISH_DATE = timezone.make_aware(timezone.datetime.fromisoformat("2018-06-16"))
 | 
					LKOMPVZVO_PUBLISH_DATE = timezone.make_aware(timezone.datetime.fromisoformat("2018-06-16")).date()
 | 
				
			||||||
 | 
				
			|||||||
@ -13,6 +13,7 @@ from django.db.models.fields.files import FieldFile
 | 
				
			|||||||
from django.urls import reverse
 | 
					from django.urls import reverse
 | 
				
			||||||
from django.utils import timezone
 | 
					from django.utils import timezone
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from analysis.settings import LKOMPVZVO_PUBLISH_DATE
 | 
				
			||||||
from intervention.tasks import celery_export_to_egon
 | 
					from intervention.tasks import celery_export_to_egon
 | 
				
			||||||
from user.models import User
 | 
					from user.models import User
 | 
				
			||||||
from django.db import models, transaction
 | 
					from django.db import models, transaction
 | 
				
			||||||
@ -325,13 +326,14 @@ class Intervention(BaseObject,
 | 
				
			|||||||
        """
 | 
					        """
 | 
				
			||||||
        now_date = timezone.now().date()
 | 
					        now_date = timezone.now().date()
 | 
				
			||||||
        binding_date = self.legal.binding_date
 | 
					        binding_date = self.legal.binding_date
 | 
				
			||||||
 | 
					        is_old_entry = binding_date < LKOMPVZVO_PUBLISH_DATE
 | 
				
			||||||
        is_binding_date_ready = binding_date is not None and binding_date <= now_date
 | 
					        is_binding_date_ready = binding_date is not None and binding_date <= now_date
 | 
				
			||||||
        is_recorded = self.recorded is not None
 | 
					        is_recorded = self.recorded is not None
 | 
				
			||||||
        is_free_of_revocations = not self.legal.revocations.exists()
 | 
					        is_free_of_revocations = not self.legal.revocations.exists()
 | 
				
			||||||
        is_ready = is_binding_date_ready \
 | 
					        is_ready = is_binding_date_ready \
 | 
				
			||||||
                   and is_recorded \
 | 
					                   and is_recorded \
 | 
				
			||||||
                   and is_free_of_revocations
 | 
					                   and is_free_of_revocations
 | 
				
			||||||
        return is_ready
 | 
					        return is_ready or is_old_entry
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_share_link(self):
 | 
					    def get_share_link(self):
 | 
				
			||||||
        """ Returns the share url for the object
 | 
					        """ Returns the share url for the object
 | 
				
			||||||
 | 
				
			|||||||
@ -17,7 +17,7 @@ from konova.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
 | 
				
			|||||||
from konova.utils.generators import generate_qr_code
 | 
					from konova.utils.generators import generate_qr_code
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def report_view(request:HttpRequest, id: str):
 | 
					def report_view(request: HttpRequest, id: str):
 | 
				
			||||||
    """ Renders the public report view
 | 
					    """ Renders the public report view
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Args:
 | 
					    Args:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user