Save new user's hosting key only in that case

This commit is contained in:
PCoder 2019-07-03 05:13:02 +05:30
parent 26fab27c3f
commit dfb16f0c25

View file

@ -849,7 +849,7 @@ class OrderConfirmationView(DetailView, FormView):
password=password) password=password)
login(request, new_user) login(request, new_user)
if 'new_user_hosting_key_id' in self.request.session: if 'new_user_hosting_key_id' in self.request.session:
user_hosting_key = UserHostingKey.objects.get(self.request.session['new_user_hosting_key_id']) user_hosting_key = UserHostingKey.objects.get(id=self.request.session['new_user_hosting_key_id'])
user_hosting_key.user = new_user user_hosting_key.user = new_user
user_hosting_key.save() user_hosting_key.save()