Ejemplo n.º 1
0
class RefusalAppealPersonalFallbackReasonStep(AppealSectionStep, ReasonStep):
    covered_reason = Action.REFUSAL_REASONS.PERSONAL
    text_template = u'inforequests/appeals/texts/refusal/personal_fallback_reason.html'
    section_template = u'inforequests/appeals/papers/refusal/personal_fallback_reason.html'

    personal_fallback = OptionalSectionCheckboxField(required=False)
    personal_fallback_reason = PaperCharField(required=False,
                                              widget=EditableSpan())

    @classmethod
    def applicable(cls, wizard):
        if not super(RefusalAppealPersonalFallbackReasonStep,
                     cls).applicable(wizard):
            return False
        return not wizard.values.get(u'personal_officer', True)

    def paper_fields(self, step):
        if self.wizard.values.get(u'personal_fallback', True):
            step.fields[u'personal_fallback_reason'] = PaperCharField(
                widget=EditableSpan())

    def section_is_empty(self):
        return not self.wizard.values.get(u'personal_fallback', True)

    def clean(self):
        cleaned_data = super(RefusalAppealPersonalFallbackReasonStep,
                             self).clean()
        fallback = cleaned_data.get(u'personal_fallback', None)
        fallback_reason = cleaned_data.get(u'personal_fallback_reason', None)
        if fallback and not fallback_reason:
            msg = self.fields[u'personal_fallback_reason'].error_messages[
                u'required']
            self.add_error(u'personal_fallback_reason', msg)
        return cleaned_data
Ejemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     super(RefusalAppealBusinessSecretDefinitionReasonStep,
           self).__init__(*args, **kwargs)
     choices = self.wizard.values.get(u'business_secret_definition', [])
     for choice in choices:
         self.fields[u'business_secret_definition_reason_' +
                     choice] = PaperCharField(widget=EditableSpan())
Ejemplo n.º 3
0
 def add_fields(self):
     super(DoesNotProvideFallbackReason, self).add_fields()
     self.fields[u'does_not_provide_fallback'] = OptionalSectionCheckboxField(
             label=_(u'inforequests:appeal:refusal:DoesNotProvideFallbackReason:does_not_provide_fallback:label'),
             )
     self.fields[u'does_not_provide_fallback_reason'] = PaperCharField(
             widget=EditableSpan(),
             )
Ejemplo n.º 4
0
class DisclosureAppealReasonStep(AppealSectionStep):
    text_template = u'inforequests/appeals/texts/disclosure.html'
    section_template = u'inforequests/appeals/papers/disclosure.html'

    reason = PaperCharField(widget=EditableSpan())

    def paper_fields(self, step):
        step.fields[u'reason'] = PaperCharField(widget=EditableSpan())
Ejemplo n.º 5
0
class RefusalAppealCopyrightReasonStep(AppealSectionStep, ReasonStep):
    covered_reason = Action.REFUSAL_REASONS.COPYRIGHT
    text_template = u'inforequests/appeals/texts/refusal/copyright_reason.html'
    section_template = u'inforequests/appeals/papers/refusal/copyright_reason.html'

    copyright_reason = PaperCharField(widget=EditableSpan())

    def paper_fields(self, step):
        step.fields[u'copyright_reason'] = PaperCharField(
            widget=EditableSpan())
Ejemplo n.º 6
0
class RefusalAppealDoesNotHaveReasonStep(AppealSectionStep, ReasonStep):
    covered_reason = Action.REFUSAL_REASONS.DOES_NOT_HAVE
    text_template = u'inforequests/appeals/texts/refusal/does_not_have_reason.html'
    section_template = u'inforequests/appeals/papers/refusal/does_not_have_reason.html'

    does_not_have_reason = PaperCharField(widget=EditableSpan())

    def paper_fields(self, step):
        step.fields[u'does_not_have_reason'] = PaperCharField(
            widget=EditableSpan())
Ejemplo n.º 7
0
 def add_fields(self):
     super(BusinessSecretFallbackReason, self).add_fields()
     self.fields[u'business_secret_fallback'] = OptionalSectionCheckboxField(
             label=_(u'inforequests:appeal:refusal:BusinessSecretFallbackReason:business_secret_fallback:label'),
             required=False,
             )
     self.fields[u'business_secret_fallback_reason'] = PaperCharField(
             required=False,
             widget=EditableSpan(),
             )
Ejemplo n.º 8
0
 def add_fields(self):
     super(ConfidentialFallbackReason, self).add_fields()
     self.fields[u'confidential_fallback'] = OptionalSectionCheckboxField(
             label=_(u'inforequests:appeal:refusal:ConfidentialFallbackReason:confidential_fallback:label'),
             required=False,
             )
     self.fields[u'confidential_fallback_reason'] = PaperCharField(
             required=False,
             widget=EditableSpan(),
             )
Ejemplo n.º 9
0
class RefusalAppealOtherReasonInvalidReasonStep(AppealSectionStep, ReasonStep):
    covered_reason = Action.REFUSAL_REASONS.OTHER_REASON
    text_template = u'inforequests/appeals/texts/refusal/other_reason_invalid_reason.html'
    section_template = u'inforequests/appeals/papers/refusal/other_reason_invalid_reason.html'

    other_reason_invalid_reason = PaperCharField(widget=EditableSpan())

    @classmethod
    def applicable(cls, wizard):
        if not super(RefusalAppealOtherReasonInvalidReasonStep,
                     cls).applicable(wizard):
            return False
        return not wizard.values.get(u'other_reason_valid', True)

    def paper_fields(self, step):
        step.fields[u'other_reason_invalid_reason'] = PaperCharField(
            widget=EditableSpan())
Ejemplo n.º 10
0
class RefusalAppealSanitizationMissingDocumentStep(AppealSectionStep,
                                                   SanitizationStep):
    text_template = u'inforequests/appeals/texts/refusal/sanitization_missing_document.html'
    section_template = u'inforequests/appeals/papers/refusal/sanitization_missing_document.html'

    sanitization_missing_document = PaperCharField(widget=EditableSpan())

    @classmethod
    def applicable(cls, wizard):
        if not super(RefusalAppealSanitizationMissingDocumentStep,
                     cls).applicable(wizard):
            return False
        return wizard.values.get(u'sanitization_level',
                                 None) == u'missing-document'

    def paper_fields(self, step):
        step.fields[u'sanitization_missing_document'] = PaperCharField(
            widget=EditableSpan())
Ejemplo n.º 11
0
class RefusalAppealSanitizationOverlySanitizedStep(AppealSectionStep,
                                                   SanitizationStep):
    text_template = u'inforequests/appeals/texts/refusal/sanitization_overly_sanitized.html'
    section_template = u'inforequests/appeals/papers/refusal/sanitization_overly_sanitized.html'

    sanitization_overly_sanitized = PaperCharField(widget=EditableSpan())

    @classmethod
    def applicable(cls, wizard):
        if not super(RefusalAppealSanitizationOverlySanitizedStep,
                     cls).applicable(wizard):
            return False
        return wizard.values.get(u'sanitization_level',
                                 None) == u'overly-sanitized'

    def paper_fields(self, step):
        step.fields[u'sanitization_overly_sanitized'] = PaperCharField(
            widget=EditableSpan())
Ejemplo n.º 12
0
class RefusalAppealPersonalOfficerReasonStep(AppealSectionStep, ReasonStep):
    covered_reason = Action.REFUSAL_REASONS.PERSONAL
    text_template = u'inforequests/appeals/texts/refusal/personal_officer_reason.html'
    section_template = u'inforequests/appeals/papers/refusal/personal_officer_reason.html'

    personal_officer_reason = PaperCharField(required=False,
                                             widget=EditableSpan())

    @classmethod
    def applicable(cls, wizard):
        if not super(RefusalAppealPersonalOfficerReasonStep,
                     cls).applicable(wizard):
            return False
        return wizard.values.get(u'personal_officer', True)

    def paper_fields(self, step):
        step.fields[u'personal_officer_reason'] = PaperCharField(
            required=False, widget=EditableSpan())
Ejemplo n.º 13
0
class RefusalAppealDoesNotProvideFallbackReasonStep(AppealSectionStep,
                                                    ReasonStep):
    covered_reason = Action.REFUSAL_REASONS.DOES_NOT_PROVIDE
    text_template = u'inforequests/appeals/texts/refusal/does_not_provide_fallback_reason.html'
    section_template = u'inforequests/appeals/papers/refusal/does_not_provide_fallback_reason.html'

    does_not_provide_fallback = OptionalSectionCheckboxField()
    does_not_provide_fallback_reason = PaperCharField(widget=EditableSpan())

    @classmethod
    def applicable(cls, wizard):
        if not super(RefusalAppealDoesNotProvideFallbackReasonStep,
                     cls).applicable(wizard):
            return False
        return not wizard.values.get(u'does_not_provide_public_funds', True)

    def paper_fields(self, step):
        step.fields[u'does_not_provide_fallback_reason'] = PaperCharField(
            widget=EditableSpan())
Ejemplo n.º 14
0
class RefusalAppealConfidentialNotConfidentialReasonStep(
        AppealSectionStep, ReasonStep):
    covered_reason = Action.REFUSAL_REASONS.CONFIDENTIAL
    text_template = u'inforequests/appeals/texts/refusal/confidential_not_confidential_reason.html'
    section_template = u'inforequests/appeals/papers/refusal/confidential_not_confidential_reason.html'

    confidential_not_confidential_reason = PaperCharField(
        required=False, widget=EditableSpan())

    @classmethod
    def applicable(cls, wizard):
        if not super(RefusalAppealConfidentialNotConfidentialReasonStep,
                     cls).applicable(wizard):
            return False
        return wizard.values.get(u'confidential_not_confidential', True)

    def paper_fields(self, step):
        step.fields[u'confidential_not_confidential_reason'] = PaperCharField(
            required=False, widget=EditableSpan())
Ejemplo n.º 15
0
 def add_fields(self):
     super(DoesNotProvidePublicFundsReason, self).add_fields()
     self.fields[u'does_not_provide_public_funds_reason'] = PaperCharField(widget=EditableSpan())
Ejemplo n.º 16
0
 def add_fields(self):
     super(CopyrightReason, self).add_fields()
     self.fields[u'copyright_reason'] = PaperCharField(widget=EditableSpan())
Ejemplo n.º 17
0
 def paper_fields(self, step):
     step.fields[u'other_reason_invalid_reason'] = PaperCharField(
         widget=EditableSpan())
Ejemplo n.º 18
0
 def paper_fields(self, step):
     step.fields[u'sanitization_overly_sanitized'] = PaperCharField(
         widget=EditableSpan())
Ejemplo n.º 19
0
 def add_fields(self):
     super(BusinessSecretDefinitionReason, self).add_fields()
     for choice in self.wizard.values[u'business_secret_definition']:
         self.fields[u'business_secret_definition_reason_' + choice] = PaperCharField(
                 widget=EditableSpan())
Ejemplo n.º 20
0
 def add_fields(self):
     super(ConfidentialNotConfidentialReason, self).add_fields()
     self.fields[u'confidential_not_confidential_reason'] = PaperCharField(
             required=False, widget=EditableSpan())
Ejemplo n.º 21
0
 def add_fields(self):
     super(PersonalOfficerReason, self).add_fields()
     self.fields[u'personal_officer_reason'] = PaperCharField(
             required=False, widget=EditableSpan())
Ejemplo n.º 22
0
 def paper_fields(self, step):
     step.fields[u'sanitization_missing_document'] = PaperCharField(
         widget=EditableSpan())
Ejemplo n.º 23
0
 def paper_fields(self, step):
     step.fields[u'does_not_provide_public_funds_reason'] = PaperCharField(
         widget=EditableSpan())
Ejemplo n.º 24
0
 def add_fields(self):
     super(SanitizationOverlySanitized, self).add_fields()
     self.fields[u'sanitization_overly_sanitized'] = PaperCharField(widget=EditableSpan())
Ejemplo n.º 25
0
 def add_fields(self):
     super(DoesNotHaveReason, self).add_fields()
     self.fields[u'does_not_have_reason'] = PaperCharField(widget=EditableSpan())
Ejemplo n.º 26
0
 def add_fields(self):
     super(DisclosureAppeal, self).add_fields()
     self.fields[u'reason'] = PaperCharField(widget=EditableSpan())
Ejemplo n.º 27
0
 def add_fields(self):
     super(SanitizationMissingDocument, self).add_fields()
     self.fields[u'sanitization_missing_document'] = PaperCharField(widget=EditableSpan())
Ejemplo n.º 28
0
 def paper_fields(self, step):
     step.fields[u'reason'] = PaperCharField(widget=EditableSpan())
Ejemplo n.º 29
0
 def add_fields(self):
     super(AdvancementAppeal, self).add_fields()
     self.fields[u'reason'] = PaperCharField(widget=EditableSpan())
Ejemplo n.º 30
0
 def add_fields(self):
     super(OtherReasonValidReason, self).add_fields()
     self.fields[u'other_reason_valid_reason'] = PaperCharField(widget=EditableSpan())