title: Django: 'int' object has no attribute 'course'
body: <p>i filter a course using <code>id</code>, i got the <code>profile</code> of the course creator and i want to add the user that purchsed the course the <code>course_creator</code> students, but i keep getting this error
  <code>'int' object has no attribute 'course'</code></p>
  <p>views.py</p>
  <pre><code>@require_http_methods(['GET', 'POST'])
  def payment_response(request, user_course_id=None):
      status=request.GET.get('status', None)
      tx_ref=request.GET.get('tx_ref', None) 
      if status == &quot;successful&quot;:
          if user_course_id:
              user_course = UserCourse.objects.filter(id=user_course_id).update(paid=True)
  
              profile = Profile.objects.get(user=user_course.course.course_creator)
              profile.my_students.add(user_course.user)
              student_profile.my_courses.add(user_course.course)
  
              student_profile.save()
              profile.save()
              user_course.save()
  
              return render(request, &quot;payment/payment-success.html&quot;)
          else:
              return render(request, &quot;payment/payment-failed.html&quot;)
      if status == &quot;cancelled&quot;:
          return render(request, &quot;payment/payment-failed.html&quot;)
  </code></pre>