Ejemplo n.º 1
0
    def get_form_kwargs(self, step=None):

        if step == 'review_changes':
            items = self.get_items()
            # Check some values from last step
            cleaned_data = self.get_change_data()
            cascade = cleaned_data['cascadeRegistration']
            state = cleaned_data['state']
            ra = cleaned_data['registrationAuthorities']

            static_content = {
                'new_state': state,
                'new_reg_date': cleaned_data['registrationDate']
            }
            # Need to check whether cascaded was true here

            if cascade == 1:
                queryset = cascade_items_queryset(items=items)
            else:
                ids = [a.id for a in items]
                queryset = MDR._concept.objects.filter(id__in=ids)

            return {
                'queryset': queryset,
                'static_content': static_content,
                'ra': ra[0],
                'user': self.request.user
            }

        return {}
    def get_context_data(self, *args, **kwargs):
        # Call the base implementation first to get a context
        context = super().get_context_data(*args, **kwargs)
        review = self.get_review()
        if review.cascade_registration:
            queryset = cascade_items_queryset(items=review.concepts.all())
        else:
            queryset = review.concepts.all()
        extra_info, any_higher = get_status_change_details(queryset, review.registration_authority, review.state)

        for concept in queryset:
            concept.info = extra_info[concept.id]

        context['statuses'] = queryset

        return context
Ejemplo n.º 3
0
    def get_context_data(self, *args, **kwargs):
        # Call the base implementation first to get a context
        context = super().get_context_data(*args, **kwargs)
        review = self.get_review()
        if review.cascade_registration:
            queryset = cascade_items_queryset(items=review.concepts.all())
        else:
            queryset = review.concepts.all()
        extra_info, any_higher = get_status_change_details(
            queryset, review.registration_authority, review.state)

        for concept in queryset:
            concept.info = extra_info[concept.id]

        context['statuses'] = queryset

        return context
    def get_form_kwargs(self, step):

        if step == 'review_changes':
            items = self.get_items()
            # Check some values from last step
            cleaned_data = self.get_change_data()
            cascade = cleaned_data['cascadeRegistration']
            state = cleaned_data['state']
            ra = cleaned_data['registrationAuthorities']

            static_content = {'new_state': state, 'new_reg_date': cleaned_data['registrationDate']}
            # Need to check wether cascaded was true here

            if cascade == 1:
                queryset = cascade_items_queryset(items=items)
            else:
                ids = [a.id for a in items]
                queryset = MDR._concept.objects.filter(id__in=ids)

            return {'queryset': queryset, 'static_content': static_content, 'ra': ra[0], 'user': self.request.user}

        return {}