django.contrib.messages.info

Here are the examples of the python api django.contrib.messages.info taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

200 Examples 7

Example 1

Project: myks-gallery
Source File: admin.py
View license
@permission_required('gallery.scan')
def scan_photos(request):
    if request.method == 'POST':
        stdout, stderr = six.StringIO(), six.StringIO()
        management.call_command('scanphotos', stdout=stdout, stderr=stderr)
        for line in stdout.getvalue().splitlines():
            messages.info(request, line)
        for line in stderr.getvalue().splitlines():
            messages.error(request, line)
        return HttpResponseRedirect(reverse('admin:gallery_scan_photos'))
    context = {
        'app_label': 'gallery',
        'title': ugettext("Scan photos"),
    }
    return render(request, 'admin/gallery/scan_photos.html', context)

Example 2

Project: volontulo
Source File: auth.py
View license
@login_required
def logout(request):
    u"""Logout view.

    :param request: WSGIRequest instance
    """
    auth.logout(request)
    messages.info(
        request,
        u"Użytkownik został wylogowany!"
    )
    return redirect('homepage')

Example 3

Project: logtacts
Source File: views.py
View license
    def get_context_data(self, *args, **kwargs):
        context = super(PaymentView, self).get_context_data(*args, **kwargs)
        if not self.book or self.book.owner != self.request.user:
            messages.info(
                self.request,
                "Sorry, only the contact book owner can add a subscription. Please contact them, or email [email protected]",
                )
        context['owns_book'] = self.book and self.book.owner == self.request.user
        context['selected_book'] = self.book 
        context['plan'] = payment_constants.PLANS[self.plan]
        context['stripe_public_key'] = settings.STRIPE_PUBLIC_KEY
        return context

Example 4

Project: pythondigest
Source File: views.py
View license
    def get_success_url(self):
        title = self.request.POST['title'].strip() or 'Без заголовка'
        link = self.request.POST['link']
        description = self.request.POST['description']
        section = self.request.POST['section']
        Item.objects.create(title=title,
                            link=link,
                            description=description,
                            status='pending',
                            related_to_date=datetime.datetime.now(),
                            section_id=section)
        messages.info(self.request,
                      'Ваша ссылка успешно добавлена на рассмотрение')
        return reverse('frontend:index')

Example 5

Project: Django-facebook
Source File: views.py
View license
def disconnect(request):
    '''
    Removes Facebook from the users profile
    And redirects to the specified next page
    '''
    if request.method == 'POST':
        messages.info(
            request, _("You have disconnected your Facebook profile."))
        profile = get_profile(request.user)
        profile.disconnect_facebook()
        profile.save()
    response = next_redirect(request)
    return response

Example 6

Project: djiki
Source File: views.py
View license
def _prepare_preview(request, form):
	messages.info(request, mark_safe(_("The content you see on this page is shown only as "
			"a preview. <strong>No changes have been saved yet.</strong> Please "
			"review the modifications and use the <em>Save</em> button to store "
			"them permanently.")))
	return form.cleaned_data.get('content', form.data['content'])

Example 7

Project: mezzanine
Source File: views.py
View license
@login_required
def profile_update(request, template="accounts/account_profile_update.html",
                   extra_context=None):
    """
    Profile update form.
    """
    profile_form = get_profile_form()
    form = profile_form(request.POST or None, request.FILES or None,
                        instance=request.user)
    if request.method == "POST" and form.is_valid():
        user = form.save()
        info(request, _("Profile updated"))
        try:
            return redirect("profile", username=user.username)
        except NoReverseMatch:
            return redirect("profile_update")
    context = {"form": form, "title": _("Update Profile")}
    context.update(extra_context or {})
    return TemplateResponse(request, template, context)

Example 8

Project: django-linkcheck
Source File: listeners.py
View license
def handle_upload(sender, path=None, **kwargs):
    url = os.path.join(get_relative_media_url(), kwargs['file'].url_relative)
    url_qs = Url.objects.filter(url=url).filter(status=False)
    count = url_qs.count()
    if count:
        url_qs.update(status=True, message='Working document link')
        msg = "Please note. Uploading %s has corrected %s broken link%s. See the Link Manager for more details" % (url, count, count>1 and 's' or '')
        messages.info(sender, msg)

Example 9

Project: django-rq
Source File: views.py
View license
@staff_member_required
def requeue_job_view(request, queue_index, job_id):
    queue_index = int(queue_index)
    queue = get_queue_by_index(queue_index)
    job = Job.fetch(job_id, connection=queue.connection)

    if request.method == 'POST':
        requeue_job(job_id, connection=queue.connection)
        messages.info(request, 'You have successfully requeued %s' % job.id)
        return redirect('rq_job_detail', queue_index, job_id)

    context_data = {
        'queue_index': queue_index,
        'job': job,
        'queue': queue,
    }
    return render(request, 'django_rq/delete_job.html', context_data)

Example 10

Project: django-rq
Source File: views.py
View license
@staff_member_required
def delete_job(request, queue_index, job_id):
    queue_index = int(queue_index)
    queue = get_queue_by_index(queue_index)
    job = Job.fetch(job_id, connection=queue.connection)

    if request.method == 'POST':
        # Remove job id from queue and delete the actual job
        queue.connection._lrem(queue.key, 0, job.id)
        job.delete()
        messages.info(request, 'You have successfully deleted %s' % job.id)
        return redirect('rq_jobs', queue_index)

    context_data = {
        'queue_index': queue_index,
        'job': job,
        'queue': queue,
    }
    return render(request, 'django_rq/delete_job.html', context_data)

Example 11

Project: horas
Source File: middleware.py
View license
    def process_request(self, request):
        if request.user.is_authenticated():
            skip_urls = [
                str(reverse_lazy('profile_update', args=[request.user.username])),
                str(reverse_lazy('account_logout')),
                str(reverse_lazy('admin:index'))
            ]

            is_skip_url = any([request.path.startswith(url) for url in skip_urls])

            if not request.user.has_complete_profile() and not is_skip_url:
                messages.info(request, _('Debes completar tu perfil para continuar'))
                return HttpResponseRedirect(skip_urls[0])

Example 12

Project: logtacts
Source File: contact_list_views.py
View license
    def form_valid(self, form, *args, **kwargs):
        contact_ids = []
        for contact in form.cleaned_data:
            if form.cleaned_data[contact]:
                contact_ids.append(contact.split('_')[1])
        self.request.session['selected_contacts'] = json.dumps(contact_ids)
        if not contact_ids:
            messages.info(self.request, "No contacts selected.")
            return HttpResponseRedirect(reverse('contacts-list'))
        if self.request.POST.get('emails'):
            return HttpResponseRedirect(reverse('contact_emails'))
        if self.request.POST.get('addresses'):
            return HttpResponseRedirect(reverse('contact_addresses'))
        if self.request.POST.get('merge'):
            return HttpResponseRedirect(reverse('contacts_merge'))
        if self.request.POST.get('addtag'):
            return HttpResponseRedirect(reverse('contacts_add_tag'))
        return HttpResponseRedirect(self.get_success_url())

Example 13

Project: feincms
Source File: modeladmins.py
View license
    @staticmethod
    @csrf_protect
    @permission_required('medialibrary.add_mediafile')
    def bulk_upload(request):
        if request.method == 'POST' and 'data' in request.FILES:
            try:
                count = import_zipfile(
                    request.POST.get('category'),
                    request.POST.get('overwrite', False),
                    request.FILES['data'])
                messages.info(request, _("%d files imported") % count)
            except Exception as e:
                messages.error(request, _("ZIP import failed: %s") % e)
        else:
            messages.error(request, _("No input file given"))

        return HttpResponseRedirect(
            reverse('admin:medialibrary_mediafile_changelist'))

Example 14

Project: classic.rhizome.org
Source File: views.py
View license
def can_vote(request, grant):
    votes_remaining = grant.proposal_votes_remaining(request.user)
    if votes_remaining <= 0:
        messages.info(request,
                      'You have voted the maximum number of times for {}. '
                      'Thank you!'.format(grant.__unicode__()))
    return votes_remaining

Example 15

Project: feincms
Source File: modeladmins.py
View license
def save_as_zipfile(modeladmin, request, queryset):
    from .zip import export_zipfile

    site = get_current_site(request)
    try:
        zip_name = export_zipfile(site, queryset)
        messages.info(request, _("ZIP file exported as %s") % zip_name)
    except Exception as e:
        messages.error(request, _("ZIP file export failed: %s") % str(e))
        return

    return HttpResponseRedirect(
        os.path.join(django_settings.MEDIA_URL, zip_name))

Example 16

Project: drum
Source File: views.py
View license
    def form_valid(self, form):
        hours = getattr(settings, "ALLOWED_DUPLICATE_LINK_HOURS", None)
        if hours and form.instance.link:
            lookup = {
                "link": form.instance.link,
                "publish_date__gt": now() - timedelta(hours=hours),
            }
            try:
                link = Link.objects.get(**lookup)
            except Link.DoesNotExist:
                pass
            else:
                error(self.request, "Link exists")
                return redirect(link)
        form.instance.user = self.request.user
        form.instance.gen_description = False
        info(self.request, "Link created")
        return super(LinkCreate, self).form_valid(form)

Example 17

Project: django-linkcheck
Source File: listeners.py
View license
def handle_delete(sender, path=None, **kwargs):

    url = os.path.join(get_relative_media_url(), DIRECTORY, path, kwargs['filename'])
    url_qs = Url.objects.filter(url=url).filter(status=True)
    count = url_qs.count()
    if count:
        url_qs.update(status=False, message='Missing Document')
        msg = "Warning. Deleting %s has caused %s link%s to break. Please use the Link Manager to fix them" % (url, count, count>1 and 's' or '')
        messages.info(sender, msg)

Example 18

Project: django-object-actions
Source File: utils.py
View license
    def message_user(self, request, message):
        """
        Mimic Django admin actions's `message_user`.

        Like the second example:
        https://docs.djangoproject.com/en/1.9/ref/contrib/admin/actions/#custom-admin-action
        """
        messages.info(request, message)

Example 19

Project: django-newsletter
Source File: admin.py
View license
    def submit(self, request, object_id):
        submission = self._getobj(request, object_id)

        if submission.sent or submission.prepared:
            messages.info(request, _("Submission already sent."))
            change_url = reverse(
                'admin:newsletter_submission_change', args=[object_id]
            )
            return HttpResponseRedirect(change_url)

        submission.prepared = True
        submission.save()

        messages.info(request, _("Your submission is being sent."))

        changelist_url = reverse('admin:newsletter_submission_changelist')
        return HttpResponseRedirect(changelist_url)

Example 20

Project: django-fancypages
Source File: views.py
View license
    def form_valid(self, form):
        self.success_url = form.cleaned_data.get('next', '/')
        messages.info(
            self.request,
            "Thanks for getting in touch. We'll respond as quickly as we can")
        return super(ContactUsView, self).form_valid(form)

Example 21

Project: teerace
Source File: views.py
View license
@render_to('accounts/user_detail.html')
def profile(request, user_id):
	if int(user_id) == 0:
		raise Http404 # mkay, no Anonymous profile
	user = get_object_or_404(User.objects.select_related(), pk=user_id)
	user_actions = actor_stream(user)[:10]
	badges = BadgeAward.objects.filter(user=user).order_by("-awarded_at")[:10]

	messages.info(request, "Please enable Javascript.",
		extra_tags="javascript")

	return {
		'profile_user': user,
		'user_actions': user_actions,
		'badges': badges,
	}

Example 22

Project: shuup
Source File: detail.py
View license
    @atomic
    def save_form(self, form):
        self.object = form.save()
        contact = self._get_bind_contact()
        if contact and not contact.user:
            contact.user = self.object
            contact.save()
            messages.info(self.request, _(u"User bound to contact %(contact)s.") % {"contact": contact})

Example 23

Project: rainmap-lite
Source File: views.py
View license
def clear_logs(request):
    """Clear admin activity logs if user has permissions"""

    if not request.user.is_authenticated(): # should be applied to anything under /console
        return redirect('login')

    if request.user.has_perm('admin.delete_logentry'):
        LogEntry.objects.all().filter(user__pk=request.user.id).delete()
        messages.info(request, 'Successfully cleared admin activity logs.', fail_silently=True)
    else:
        messages.warning(request, 'Unable to clear the admin activity logs.', fail_silently=True)

    return redirect('admin:index')

Example 24

Project: oioioi
Source File: views.py
View license
def rejudge_model_solutions_view(request, problem_instance_id):
    problem_instance = \
            get_object_or_404(ProblemInstance, id=problem_instance_id)
    contest = problem_instance.contest
    if not request.user.has_perm('contests.contest_admin', contest):
        raise PermissionDenied
    ModelSolution.objects.recreate_model_submissions(problem_instance)
    messages.info(request, _("Model solutions sent for evaluation."))
    return redirect('model_solutions', problem_instance.id)

Example 25

Project: shuup
Source File: edit.py
View license
    def form_valid(self, form):
        for shop in self.shops:
            shop_product_form = form["shop%d" % shop.pk]
            if not shop_product_form.changed_data:
                continue
            if not shop_product_form.instance.pk:
                shop_product_form.instance.product = self.object

            original_quantity = shop_product_form.instance.minimum_purchase_quantity
            rounded_quantity = self.object.sales_unit.round(original_quantity)
            if original_quantity != rounded_quantity:
                messages.info(self.request, _("Minimum Purchase Quantity has been rounded to match Sales Unit."))

            shop_product_form.instance.minimum_purchase_quantity = rounded_quantity

            inst = shop_product_form.save()
            messages.success(self.request, _("Changes to shop instance for %s saved") % inst.shop)

Example 26

Project: zipfelchappe
Source File: views.py
View license
def pledge_cancel(request):
    """ Remove current pledge from session """
    pledge = get_session_pledge(request)

    if not pledge:
        return redirect('zipfelchappe_project_list')
    else:
        del request.session['pledge_id']
        pledge.mark_failed('user cancelled payment')
        messages.info(request, _('Your pledge was cancelled'))
        return redirect('zipfelchappe_project_detail', slug=pledge.project.slug)

Example 27

Project: djangobb
Source File: views.py
View license
@login_required
@transaction.atomic
def delete_subscription(request, topic_id):
    topic = get_object_or_404(Topic, pk=topic_id)
    topic.subscribers.remove(request.user)
    messages.info(request, _("Topic subscription removed."))
    if 'from_topic' in request.GET:
        return HttpResponseRedirect(reverse('djangobb:topic', args=[topic.id]))
    else:
        return HttpResponseRedirect(reverse('djangobb:forum_profile', args=[request.user.username]))

Example 28

Project: aemanager
Source File: decorators.py
View license
def settings_required(view_func, redirect_field_name=REDIRECT_FIELD_NAME):
    """
    decorator which redirects to settings page if mandatory
    values are not set, use login_required.
    """
    def decorator(request, *args, **kwargs):
        if request.user.get_profile().settings_defined():
            return view_func(request, *args, **kwargs)
        messages.info(request, _('You need to fill these informations to continue'))
        return HttpResponseRedirect(reverse('settings_edit'))
    return login_required(wraps(view_func, assigned=available_attrs(view_func))(decorator), redirect_field_name=redirect_field_name)

Example 29

Project: django-paypal
Source File: admin.py
View license
def reverify_flagged(modeladmin, request, queryset):
    q = queryset.filter(flag=True)
    for ipn in q:
        ipn.verify()
        ipn.send_signals()
    messages.info(request, "{0} IPN object(s) re-verified".format(len(q)))

Example 30

Project: muspy
Source File: views.py
View license
@login_required
def artists_remove(request):
    names = request.POST.getlist('name')
    mbids = request.POST.getlist('id')
    if not names and not mbids:
        messages.info(request, 'Use checkboxes to select the artists you want to remove.')
        return redirect('/artists')

    if names:
        UserSearch.remove(request.user, names)
        messages.success(request, 'Removed %d pending artists.' % len(names))
        return redirect('/artists')

    UserArtist.remove(request.user, mbids)
    messages.success(request, 'Removed %d artist%s.' % (len(mbids), 's' if len(mbids) > 1 else ''))
    return redirect('/artists')

Example 31

Project: element43
Source File: views.py
View license
def logout(request):
    """
    View for logging users out
    """

    if request.user.is_authenticated():
        django_logout(request)
        # Redirect
        messages.info(request, 'You were logged out successfully.')
    return HttpResponseRedirect(reverse('home'))

Example 32

Project: fabric-bolt
Source File: views.py
View license
    def get(self, request, *args, **kwargs):
        self.project_id = kwargs.get('pk')

        cache.delete_many(['project_{}_fabfile_tasks'.format(self.project_id),
                           'project_{}_fabfile_path'.format(self.project_id)])

        messages.info(request, "Tasks cache invalidated.")

        return super(ProjectInvalidateCache, self).get(request, *args, **kwargs)

Example 33

Project: 2buntu-blog
Source File: views.py
View license
@login_required
def logout(request):
    """
    Log a user out.
    """
    logout_user(request)
    messages.info(request, "You have successfully been logged out.")
    return redirect('home')

Example 34

Project: django-powerdns-manager
Source File: actions.py
View license
def force_serial_update(modeladmin, request, queryset):
    """Action that updates the serial resets TTL information on all resource
    records of the selected zones.
    """
    if not modeladmin.has_change_permission(request):
        raise PermissionDenied
    for domain in queryset:
        domain.update_serial()
    n = queryset.count()
    messages.info(request, 'Successfully updated %d zones.' % n)

Example 35

Project: django-multimail
Source File: views.py
View license
    def get(self, request, username):
        user = get_object_or_404(User, username=username)
        if user == request.user:
            user.delete()
        messages.info(request, "The user account for %s has been deleted" % username)
        return redirect('/')

Example 36

Project: django-pki
Source File: views.py
View license
@login_required
def pki_refresh_metadata(request):
    """Rebuild PKI metadate.
    
    Renders openssl.conf template and cleans PKI_DIR.
    """
    
    ca_objects = list(CertificateAuthority.objects.all())
    refresh_pki_metadata(ca_objects)
    messages.info(request, 'Successfully refreshed PKI metadata (%d certificate authorities)' % len(ca_objects))
    
    back = request.META.get('HTTP_REFERER', None) or '/'
    return HttpResponseRedirect(back)

Example 37

Project: Misago
Source File: auth.py
View license
@csrf_protect
@never_cache
def logout(request):
    if request.method == 'POST':
        auth.close_admin_session(request)
        messages.info(request,
                      _("Your admin session has been closed."))
        return redirect('misago:index')
    else:
        return redirect('misago:admin:index')

Example 38

Project: django-mongoadmin
Source File: views.py
View license
    @method_decorator(never_cache)
    def delete_view(self, request, collection, object_id):
        cls, admin = self.verify_collection(collection)
        document = get_document_or_404(cls, id=object_id)
        if request.method == 'POST':
            document.delete()
            msg = _('The %(name)s "%(obj)s" has been deleted.') % {'name': force_unicode(admin.verbose_name), 'obj': force_unicode(document)}
            messages.info(request, msg)
            return HttpResponseRedirect(reverse('mongoadmin:changelist', args=(collection,)))
        return render_to_response('mongoadmin/delete_confirmation.html', {
            'document': document,
            'collection': collection,
            'admin': admin,
            'title': _('Delete %s') % admin.verbose_name
            }, context_instance=RequestContext(request))

Example 39

Project: mezzanine
Source File: views.py
View license
def password_reset(request, template="accounts/account_password_reset.html",
                   form_class=PasswordResetForm, extra_context=None):
    form = form_class(request.POST or None)
    if request.method == "POST" and form.is_valid():
        user = form.save()
        send_verification_mail(request, user, "password_reset_verify")
        info(request, _("A verification email has been sent with "
                        "a link for resetting your password."))
    context = {"form": form, "title": _("Password Reset")}
    context.update(extra_context or {})
    return TemplateResponse(request, template, context)

Example 40

Project: django-oscar
Source File: views.py
View license
    def _change_users_active_status(self, users, value):
        for user in users:
            if not user.is_superuser:
                user.is_active = value
                user.save()
        messages.info(self.request, _("Users' status successfully changed"))
        return redirect('dashboard:users-index')

Example 41

Project: coursys
Source File: views.py
View license
def page_version(request, course_slug, page_label, version_id):
    offering = get_object_or_404(CourseOffering, slug=course_slug)
    page = get_object_or_404(Page, offering=offering, label=page_label)
    member = _check_allowed(request, offering, page.can_write, page.editdate())
    # check that we have an allowed member of the course (and can continue)
    if not member:
        return _forbidden_response(request, page.get_can_write_display())
    
    version = get_object_or_404(PageVersion, page=page, id=version_id)
    
    messages.info(request, "This is an old version of this page.")
    context = {'offering': offering, 'page': page, 'version': version,
               'is_old': True}
    return render(request, 'pages/view_page.html', context)

Example 42

Project: django-secure-auth
Source File: runners.py
View license
    def settings_remove(self):
        step = 4 if self.obj else 1

        if SMS_FORCE is True and self.view == 'phone_settings':
            messages.info(
                self.request, _('Default backend can not be removed'))
            return self._redirect(1)

        self.obj and self.obj.delete()
        UserAuthNotification.notify(
            self.request, _('Auth method was disabled'))
        return self._redirect(step)

Example 43

Project: fixmydjango
Source File: views.py
View license
    def form_valid(self, form):
        response = super().form_valid(form)

        messages.info(self.request,
                      "Thank you for adding a new exception! "
                      "Soon its solution will be available.")
        draft_url = self.request.build_absolute_uri(
            reverse('admin:drafts_draft_change', args=[self.object.id]))
        send_templated_mail(
            template_name='new_draft',
            from_email=settings.DEFAULT_FROM_EMAIL,
            recipient_list=['[email protected]'],
            context={
                'draft': self.object,
                'draft_url': draft_url})

        return response

Example 44

Project: btb
Source File: views.py
View license
@login_required
def delete_post(request, post_id):
    _assert_can_manage_posts(request)
    post = get_object_or_404(Document, pk=post_id, author=request.user)
    if request.method == 'POST':
        post.full_delete()
        messages.info(request, "Post deleted.")
        return redirect("blogs.manage_posts")
    return render(request, "blogs/delete_post.html", {
        'post': post,
    })

Example 45

Project: sfm-ui
Source File: views.py
View license
    def get_redirect_url(self, *args, **kwargs):
        collection = get_object_or_404(Collection, pk=kwargs['pk'])
        collection.is_active = not collection.is_active
        collection.history_note = ""
        if collection.is_active:
            messages.info(self.request, "Harvesting is turned on.")
        else:
            messages.info(self.request, "Harvesting is turned off.")
        collection.save()
        return super(CollectionToggleActiveView, self).get_redirect_url(*args, **kwargs)

Example 46

Project: django-secure-auth
Source File: runners.py
View license
    def form_valid(self, form):
        form_set = self.get_form_set()
        form.save(commit=False)
        form.user = self.request.user
        instance = form.save()
        if form_set is not None and form_set.is_valid():
            form_set.instance = instance
            form_set.save()
        messages.info(self.request, _('Successfully saved'))
        if not form.cleaned_data.get('enabled'):
            UserAuthNotification.notify(
                self.request, _('Your settings has changed'), force=True)
        return redirect(self.view)

Example 47

Project: hue
Source File: views.py
View license
def clone_design(request, design_id):
  """Clone a design belonging to any user"""
  design = authorized_get_design(request, design_id)

  if design is None:
    LOG.error('Cannot clone non-existent design %s' % (design_id,))
    return list_designs(request)

  copy = design.clone(request.user)
  copy.save()

  name = copy.name + '-copy'
  design.doc.get().copy(content_object=copy, name=name, owner=request.user)

  messages.info(request, _('Copied design: %(name)s') % {'name': design.name})

  return format_preserving_redirect(request, reverse(get_app_name(request) + ':execute_design', kwargs={'design_id': copy.id}))

Example 48

Project: sublimall-server
Source File: views.py
View license
    def post(self, request):
        if request.user.is_authenticated():
            return HttpResponseRedirect(reverse('account'))

        email = request.POST.get('email')
        msg = (
            "If you give me a valid email, you'll "
            "received an email with some help.")

        try:
            member = Member.objects.get(email=email)
        except Member.DoesNotExist:
            messages.info(request, msg)
            return HttpResponseRedirect(reverse('login'))

        member.send_registration_confirmation(reset_key=True)
        messages.info(request, msg)
        return HttpResponseRedirect(reverse('login'))

Example 49

Project: villagescc
Source File: views.py
View license
@staff_member_required
@render()
def email_users(request):
    if request.method == 'POST':
        form = EmailUsersForm(request.POST)
        if form.is_valid():
            sent_count = form.send()
            messages.info(
                request, _("Email sent to %d subscribed users.") % sent_count)
            return redirect('admin:index')
    else:
        form = EmailUsersForm()
    return locals()

Example 50

Project: SmartElect
Source File: views_changeset.py
View license
    def dispatch(self, request, *args, **kwargs):
        changeset = self.get_object()
        if not changeset.in_editable_status():
            messages.info(request, _("Changeset can no longer be edited"))
            return redirect('read_changeset', pk=changeset.pk)
        return super(ChangesetEdit, self).dispatch(request, *args, **kwargs)