Don't crash when adding models with optional m2m fields
commit65d0854f83f730f50a0c33fc25761a47ff2af8e6
authorMagnus Hagander <magnus@hagander.net>
Thu, 28 Dec 2017 15:09:31 +0000 (28 16:09 +0100)
committerMagnus Hagander <magnus@hagander.net>
Thu, 28 Dec 2017 15:09:31 +0000 (28 16:09 +0100)
tree201bf25c625ec540b1289b4586518a9c8772138f
parent0b7ef6d457bd915ffd2b789633cfaf59e11dd9f1
Don't crash when adding models with optional m2m fields

If the m2m field is optional, there will be no "pre" data available, not
even an empty one. Don't crash in this case, just assume it's empty
(which it is).

This could happen when adding a new Organisation, which currently is the
only model we have with optional m2m fields
pgweb/util/signals.py