neon-jungle / wagtail-birdsong

Create, send, preview, edit and test email campaigns from within Wagtail
BSD 3-Clause "New" or "Revised" License
103 stars 27 forks source link

Inspecting Campaing #7

Closed glanzel closed 3 years ago

glanzel commented 3 years ago

When inspecting a already send Campaign. Eventhough the email is sucessfully send und Recipients is is still written Success = False

Contact | Succeess | Sent date -- | -- | --
username@domain.com | False | Jan. 20, 2021, 1:37 p.m.
glanzel commented 3 years ago

Seems to me that success is never set in the process of sending and instead only the default value is written to the Database. class Receipt(models.Model): success = models.BooleanField(default=False)

seb-b commented 3 years ago

Yep, this is an oversight. The campaign is marked as Sent but the individual receipts are never marked as successful. I wonder how useful it is now I think about it, a receipt is not created if the campaign doesn't send, so it's successful by definition.

glanzel commented 3 years ago

in this case if you just set models.BooleanField(default=True) it shows the correct value. And later you could add additional checks if wanted.

MaximMalyavkoSolbeg commented 2 years ago

Sorry, I would like to clarify.

I didn't find appropriate migration (https://github.com/neon-jungle/wagtail-birdsong/tree/master/birdsong/migrations) for this changing:

Was it intentional?

I'll try to explain why it is interesting for me.

  1. I create my custom contact model and inherit from birdsong.models.Contact
  2. I run 'manage.py makemigrations' and receive two new migrations:
    • in packet 'birdsong' in my venv '0005auto... .py'. The migration realizes changing above.
    • in my app '0001_initial.py'. In this migration I see dependencies dependencies = [ ('birdsong', '0005_auto_...'), ... ]

As result, when I transfer the changes to container in production via CI/CD I can't migrate, because of course there are not migration '0005auto... .py' in packet 'birdsong' on production.

As workaround I can change dependencies in my migration file: from ('birdsong', '0005auto...') to ('birdsong', '0004_campaign_status'). But I'm worried that this may cause issues with updating wagtail-birdsong version in the future.

Thank you.