Improve account creation
rajesh188 opened this issue · 4 comments
rajesh188 commented
This line
initial["code"] = "{0:02d}".format(Account.objects.count() + 1)
Fails integrity constraint when deleting intermediate accounts
It should be set like this i think
initial["code"] = "{0:02d}".format(Account.objects.latest(). Id + 1)
rajesh188 commented
For example you create 10accounts and then in the middle you delete 5th and 6th account then try to create other new accounts fails parent code unique together constraint
adamcharnock commented
Hey @rajesh188, my apologies for the delay, and thank you very much for catching this. I've just implemented the fix as you suggested (see above commit).
adamcharnock commented
Just released 1.8.2
rajeshr188 commented
Thanks to you .this project is awesome I learned a lot
…On Wed 24 Oct, 2018, 6:40 AM Adam Charnock, ***@***.***> wrote:
Just released 1.8.2
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#27 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AjL9BUS7NHZ25K5feWOaP48YNgSH8pfrks5un74ggaJpZM4WkiAw>
.