@zstumgoren Here's a copy paste of the issue that I have and posted in the other thread couple days ago.
I've quit for the day, I'm running into an issue that I don't know how to solve atm and it's 8.30 so it's about time I quit.
Here's the issue, hope you can help.
I've set up everything pretty neatly, I dare say. When you click 'subscribe', you'll get an initial email that will acknowledge your subscription (I should tweak the text a little bit since I won't be sending an overview of the initial results, but that's minor details).
Then, when you go to tasks.py, you can see the task. It's supposed to compare the ids of the last search instance (first one being the moment you hit 'subscribe') with the current search instance, fetch the new IDs, run them through the database and get the corresponding objects that can populate the email. Then, it updates that particular subscription so that the new search results are stored.
Right now, I have set it up a bit differently than it should be set up when everything runs. For instance, I currently check whether total == sub.total while in the actual app, this should be total > sub.total because that indicates new results. Obviously, this is done for testing purposes.
Another thing that I did is prepopulate the 'when' list with some IDs, so that the email would actually get some results. Otherwise, there would be nothing in the list and I think (but didn't try this) that the code would break there.
Right now, the code breaks somewhere else: in the email department. The error message that I get is as follows:
File (xxx) in sub_job:
send_results_email(user, sub, output)
File (xxx) in send_results_email:
user=user, subscription=subscription, results=results)
File (xxx) in render_template:
ctx.app.update_template_context(context)
AttributeError: 'NoneType' object has no attribute 'app'
You'll have to look in emails.py, this is where those functions and files are.
I've looked briefly online and from what I can see, it somehow means that you're trying to instantiate something from Flask while the app is not present there. Which is... weird... because all the other emails are working, and I can't see anything that I've done differently. But there must be something going on.
Hope you can check with me - pushed changes to master.
@zstumgoren Here's a copy paste of the issue that I have and posted in the other thread couple days ago.
I've quit for the day, I'm running into an issue that I don't know how to solve atm and it's 8.30 so it's about time I quit.
Here's the issue, hope you can help.
I've set up everything pretty neatly, I dare say. When you click 'subscribe', you'll get an initial email that will acknowledge your subscription (I should tweak the text a little bit since I won't be sending an overview of the initial results, but that's minor details).
Then, when you go to tasks.py, you can see the task. It's supposed to compare the ids of the last search instance (first one being the moment you hit 'subscribe') with the current search instance, fetch the new IDs, run them through the database and get the corresponding objects that can populate the email. Then, it updates that particular subscription so that the new search results are stored.
Right now, I have set it up a bit differently than it should be set up when everything runs. For instance, I currently check whether total == sub.total while in the actual app, this should be total > sub.total because that indicates new results. Obviously, this is done for testing purposes.
Another thing that I did is prepopulate the 'when' list with some IDs, so that the email would actually get some results. Otherwise, there would be nothing in the list and I think (but didn't try this) that the code would break there.
Right now, the code breaks somewhere else: in the email department. The error message that I get is as follows:
You'll have to look in emails.py, this is where those functions and files are.
I've looked briefly online and from what I can see, it somehow means that you're trying to instantiate something from Flask while the app is not present there. Which is... weird... because all the other emails are working, and I can't see anything that I've done differently. But there must be something going on.
Hope you can check with me - pushed changes to master.