What's your opinion about this?

55 views
Skip to first unread message

jrief

unread,
Aug 29, 2013, 5:39:55 AM8/29/13
to djang...@googlegroups.com
Aleš Kocjančič and I had a discussion about https://github.com/divio/django-shop/issues/246 whether the shop software shall send signals upon transition of Order.status.

Here is my original post:

From my point of view it is a basic requirement for e-commerce software to inform the customer on the status of his order, ie. "order confirmed", "payment received", "article(s) shipped". Therefore the shop software shall send the corresponding signals upon order status changes. Sure, it it easy to override model Order and implement this yourself, but as a developer I expect such a functionality from the software I "buy", rather then having to implement it myself.

An other point to consider is, that Order.status shall behave like a finite state machine. That means that a transition of the status shall only occur on predefined graphs. For instance, it does not make any sense to change Order.status from Canceled to Shipped. 

Additionally I see it as security feature to disallow the transition of Order.status from Confirmed to Completed, if the payment was not fully received. Its far too easy for an administrator to forget to check account statements and erroneously change that status without having fully received the payment. As a developer, I therefore expect that the software I deploy out of the box, prevents the user from such basic mistakes.

and Aleš Kocjančič's reply:

I agree with your point about having a solid and secure shop out of the box, but that is not what django-shop is. Django-shop is a framework made for developers to build upon, and it should not get in the developers way by implementing too specific features.
Similarly, django-admin was not meant to be used by end users. Ideally, shop maintainers should have a custom made interface, that limits what they can do. The admin should be just a tool for me as a developer, to browse the data and fix any problems in it. So when I change some field, I mean it ;)

What do you think?

Avraham Serour

unread,
Aug 29, 2013, 8:51:46 AM8/29/13
to djang...@googlegroups.com
I also agree on having signals on status changes, but because this functionality is common enough to be included in the core, something no so common could be a plugin, or if simple enough to have a recipe in the documentation.

I don't agree on having a finite state machine, something that doesn't make sense to you may be possible in another business.
let's say user cancelled order, but then customer service decided to ship it anyway since he's such a good customer.

signals should take care of this, register a pre signal and authorize it or not according to your business logic.

but it should keep track of changes, it is weird to have something going from cancelled to shipped so customer services should also add a note why it did change, who did it etc.

as for security: this could probably be prevented with signals, if one day we have a starter project template it could come with some signal checking for a common status flow.

django admin was not intended for end users, but it may eventually be used by end users in a hurry or until you make your own.

the admin should be just for the developer, but on the other hand you can define add|change|delete for each user. models you don't have proper authorization won't appear on your admin page



--
You received this message because you are subscribed to the Google Groups "django-shop" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-shop...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ales Kocjancic

unread,
Aug 29, 2013, 10:45:07 AM8/29/13
to djang...@googlegroups.com
Just to be clear, I'm no against signals, I'm agains changing the order status unexpectedly in the admin.

jrief

unread,
Aug 30, 2013, 6:18:43 PM8/30/13
to djang...@googlegroups.com
On Thursday, August 29, 2013 4:45:07 PM UTC+2, Ales Kocjancic wrote:
Just to be clear, I'm no against signals, I'm agains changing the order status unexpectedly in the admin.

And what about forbidding status changes which do not make sense, together with helpful error messages?

For instance, do not allow status change from Confirmed to Completed, if Order is not fully paid. If in the admin interface, someone tries to change the status nevertheless, he gets a nice error message.

What do you think about such a feature?

Reply all
Reply to author
Forward
0 new messages