Giter Site home page Giter Site logo

wagtail-packages / wagtail-qrcode Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 299 KB

This package can be used to create a page in Wagtail CMS that has a corresponding QR Code.

License: MIT License

Python 62.03% Makefile 1.59% HTML 31.74% CSS 4.64%
qrcode-generator wagtail-cms wagtail-plugin

wagtail-qrcode's People

Contributors

catilgan-nextension avatar nickmoreton avatar pre-commit-ci[bot] avatar superman32432432 avatar

Stargazers

 avatar

Watchers

 avatar

wagtail-qrcode's Issues

Add more options around emailing

Be nice to be able to customise the email message when sending the qr-code

Other ideas

  • Multiple email recipients
  • Custom action rather than sending on save draft or publish

QRCode hook throws seg fault if page is not live

In lines 29 and 30 of wagtail_hooks.py,

rev = page.save_revision()
rev.publish()

will throw seg fault if page has not been published (e.g. draft status)

My workaround is

rev = page.save_revision()
if page.live:
    rev.publish()

The delete qr-code eps hook cannot find the id of the document when a proxy page is called

When deleting a page, this code is called

@hooks.register("after_delete_page")
def delete_document(request, page):
    doc = get_document_model().objects.filter(id=page.qr_code_eps.id)
    if doc:
        doc.delete()

However, when a proxy page model is called, this throws a seg fault, complaining that
"'NoneType' object has no attribute 'id'".

My money patch is to change page.qr_code_eps.id to page.specific.qr_code_eps.id.

@hooks.register("after_delete_page")
def delete_document(request, page):
    if hasattr(page, 'qr_code_eps') and page.specific.qr_code_eps:
        doc = get_document_model().objects.filter(id=page.specific.qr_code_eps.id)
        if doc:
            doc.delete()

Save as draft doesn't work

If you choose to save a page as a draft it gets published.

The workaround is to un-publish the page.

A fix will be made available soon.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.