1👍
✅
The problem is in the line
cur.execute("SELECT logmsg.message_id, COUNT(logmsg.log_id) AS TotalUsers, logmsg.sent_on AS Sent_ON, logmsg.log_status, msg.message_subject FROM sendmessage_log_messages logmsg, sendmessage_messages msg WHERE from_name = '"+ str(request.user.email) +"' and logmsg.message_id = msg.message_id GROUP BY logmsg.message_id, logmsg.sent_on, logmsg.log_status, msg.message_subject;")
where you are trying to use request.user.email
.
Try using self.request.user.email
instead.
Source:stackexchange.com