title: Why do I get a userId duplicate key error even though my model does not have user as the primary key?
body: <p>I have an Interactions model which inherits from the predefine django user model, but I have the messageId to be the primary key.</p>
  
  <p>models.py:</p>
  
  <pre><code>class Interaction(models.Model):
  messageId = models.TextField(max_length=5000,primary_key=True, unique = True)
  user = models.OneToOneField(User, primary_key = False, on_delete=models.CASCADE)
  reciever = models.TextField(max_length=5000,blank=True,default='')
  sender = models.TextField(max_length=5000,blank=True,default='')
  date = models.TextField(max_length=5000,blank=True,default='')
  subject = models.TextField(max_length=5000,blank=True,default='')
  label = models.TextField(max_length=5000,blank=True,default='')
  </code></pre>
  
  <p>I have a dictionary called data which stores the information required. In views.py</p>
  
  <pre><code>entry, created = Interaction.objects.get_or_create(messageId=data['id'])
  entry.user = request.user
  entry.sender = data['from']
  entry.reciever = data['to']
  entry.date = data['date']
  entry.subject = data['subject']
  entry.label = data['label']
  entry.save()
  </code></pre>
  
  <p>So while running the code there are messages with the same user but obviously different message ids</p>
  
  <p>user is not my primary key yet I keep getting the error
  <code>djongo.sql2mongo.SQLDecodeError: FAILED SQL: UPDATE "mainapp_interaction" SET "user_id" = %(0)s, "reciever" = %(1)s, "sender" = %(2)s, "date" = %(3)s, "subject" = %(4)s, "label" = %(5)s WHERE "mainapp_interaction"."messageId" = %(6)s
  Pymongo error: {'index': 0, 'code': 11000, 'errmsg': 'E11000 duplicate key error collection: 5d02255b9ccf640b8c608ee1_mysitev6.mainapp_interaction index: user_id_1 dup key: { : 16 }'}</code></p>