get_or_create() returns the tuple which contains 2 values and the 1st value is an object and the 2nd value is the boolean value which indicates that a new object is created or not as shown below:
# 1st # 2nd
(object, boolean)
So, if you want both an object and a boolean value, put one more variable created
after customer.source
as shown below:
# Here
customer.source, created = Source.objects.get_or_create(name="Website")
# object # boolean
And, if you want only an object without a boolean value, put [0]
just after get_or_create()
as shown below:
# Here ↓↓↓
customer.source = Source.objects.get_or_create(name="Website")[0]
# object
And, if you want only a boolean value without an object put [1]
just after get_or_create()
as shown below:
# Here ↓↓↓
created = Source.objects.get_or_create(name="Website")[1]
# boolean