[Answer]-Model not being recognized

1👍

✅

Try not to use name of instance same as class.Try this:

from django.shortcuts import get_object_or_404
from payments.models import user_status

def verifica_pgto(request):
    if ....
        us = get_object_or_404(user_status)
    ......
        us.objects.get(name = 'inativo')
    ....

Leave a comment