Remove hard-coded user model in recent migrations

This ensures a custom User model can be used with migrations.
Attach basket to request before applying offers

apply_offers_to_basket may depend on it, so we attach it before calling
that.

Reported and code supplied by @vovanbo. I re-did the work to add
comments.

Fixes #1172