<commit_before>from django.contrib import messages
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy
from django.views.decorators.http import require_GET

from corehq import toggles
from corehq.apps.domain.views.base import BaseDomainView
from corehq.apps.hqwebapp.utils import get_bulk_upload_form
from corehq.apps.locations.models import LocationType
from corehq.apps.locations.permissions import require_can_edit_locations
from corehq.apps.locations.views import LocationsListView
from corehq.util.files import safe_filename_header
from corehq.util.workbook_json.excel import WorkbookJSONError, get_workbook
from custom.icds.location_reassignment.download import Download
from custom.icds.location_reassignment.dumper import Dumper
from custom.icds.location_reassignment.parser import Parser


@method_decorator([toggles.LOCATION_REASSIGNMENT.required_decorator()], name='dispatch')
@method_decorator(require_can_edit_locations, name='dispatch')
class LocationReassignmentView(BaseDomainView):
    section_name = ugettext_lazy("Locations")

    page_title = ugettext_lazy('Location Reassignment')
    urlname = 'location_reassignment'
    template_name = 'icds/location_reassignment.html'

    def section_url(self):
        return reverse(LocationsListView.urlname, args=[self.domain])

    @property
    def page_context(self):
        context = super().page_context
        context.update({
            'bulk_upload': {
                "download_url": reverse('download_location_reassignment_template', args=[self.domain]),
                "adjective": _("locations"),
                "plural_noun": _("location operations"),
                "help_link": "TODO",
            },
        })
        context.update({
            'bulk_upload_form': get_bulk_upload_form(context),
        })<commit_msg>inherit from correct baseview<commit_after>from django.contrib import messages
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy
from django.views.decorators.http import require_GET

from corehq import toggles
from corehq.apps.hqwebapp.utils import get_bulk_upload_form
from corehq.apps.locations.models import LocationType
from corehq.apps.locations.permissions import require_can_edit_locations
from corehq.apps.locations.views import BaseLocationView, LocationsListView
from corehq.util.files import safe_filename_header
from corehq.util.workbook_json.excel import WorkbookJSONError, get_workbook
from custom.icds.location_reassignment.download import Download
from custom.icds.location_reassignment.dumper import Dumper
from custom.icds.location_reassignment.parser import Parser


@method_decorator([toggles.LOCATION_REASSIGNMENT.required_decorator()], name='dispatch')
@method_decorator(require_can_edit_locations, name='dispatch')
class LocationReassignmentView(BaseLocationView):
    section_name = ugettext_lazy("Locations")

    page_title = ugettext_lazy('Location Reassignment')
    urlname = 'location_reassignment'
    template_name = 'icds/location_reassignment.html'

    def section_url(self):
        return reverse(LocationsListView.urlname, args=[self.domain])

    @property
    def page_context(self):
        context = super().page_context
        context.update({
            'bulk_upload': {
                "download_url": reverse('download_location_reassignment_template', args=[self.domain]),
                "adjective": _("locations"),
                "plural_noun": _("location operations"),
                "help_link": "TODO",
            },
        })
        context.update({
            'bulk_upload_form': get_bulk_upload_form(context),
        })
{'fraction_non_alphanumeric': 0.08163777945239889, 'fraction_numerical': 0.0, 'mean_word_length': 4.584852734922861, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2754652', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1117, 'n_words': 230}