title: ValueError: Cannot assign "<Merchant: anonymous>": "Store.merchant" must be a "User" instance
body: <p>I get an error while creating merchant object and store_categories object. I get an error 'ValueError: Cannot assign "": "Store.merchant" must be a "User" instance.
  ' I could not resolve an issue.</p>
  
  <p><strong>My merchant object looks like this</strong> </p>
  
  <pre><code>[
  "merchant": {
              "id": 6,
              "username": "name",
              "first_name": "martin",
              "last_name": "lee",
              "email": "emailname@gmail.com"
          },
  ],
  </code></pre>
  
  <p><strong>My store_Categories object looks like this</strong></p>
  
  <pre><code>       "store_categories": [
          {
              "id": 4,
              "product": {
                  "id": 1,
                  "image": {
                      "id": 1,
                      "imageName": "fishCutlet.jpg",
                      "image": "http://localhost:8000/api/stores/list/products/images/fishCutlet.jpg"
                  },
                  "name_of_product": "Fish Cutlet",
                  "description": "Steamed fish minced with spices, combined with potatoes, shaped into cutlets and fried.",
                  "price": "150.00",
                  "active": true
              },
              "store_category": "FOODS"
          },
          {
              "id": 5,
              "product": {
                  "id": 2,
                  "image": {
                      "id": 2,
                      "imageName": "chickenChowmein.jpg",
                      "image": "http://localhost:8000/api/stores/list/products/images/chickenChowmein.jpg"
                  },
                  "name_of_product": "Chicken Chowmin",
                  "description": "Delicious chicken chowmein with spicy flavor and herbs that makes it hygienic",
                  "price": "120.00",
                  "active": true
              },
              "store_category": "FOODS"
          }
      ],
  </code></pre>
  
  <p><strong>My StoreCreateSerializer code</strong></p>
  
  <pre><code>class StoreCreateSerializer(ModelSerializer):
      store_categories = StoreCategorySerializer()
      merchant = UserSerializer()
      class Meta:
          model = Store
          fields=("id",
                  "merchant",
                  "store_categories",
                  "name_of_legal_entity",
                  "pan_number",
                  "registered_office_address",
                  "name_of_store",
                  "store_contact_number",
                  "store_long",
                  "store_lat",
                  "store_start_time",
                  "store_end_time",
                  "store_off_day",
                  )
      def create(self,validated_data):
          store_categories_data = validated_data.pop('store_categories')
          merchant_data = validated_data.pop('merchant')
          for merchantKey, merchantVal in merchant_data.items():
              try:
                  user = User.objects.create(username=merchantVal)
                  merchant,created = Merchant.objects.get_or_create(user=user)
                  validated_data['merchant']=merchant
                  store = Store.objects.create(**validated_data)
                  for store_categories in store_categories_data:
                      store_categories, created = StoreCategory.objects.get_or_create(pan_number=store_categories['pan_number'])
                      store_categories.product.store = store
                      store_categories.save()
                  return store
              except User.DoesNotExist:
                  raise NotFound('not found')
  </code></pre>