dcai / airnotifier

Push Notifications Server for Human Beings.
Other
593 stars 187 forks source link

app.py: Fix for mongodb authentication #206

Closed DrCuriosity closed 4 years ago

DrCuriosity commented 4 years ago

In app.py, the code for optionally authenticating on the MongoDB master instance seems to have been merged in before the code that assigns a value to the masterdb variable.

The non-authenticating case would be unaffected, but I'm getting a NameError: name 'masterdb' is not defined when I try to run the app.

This change fixes the ordering.

dcai commented 4 years ago

Hi @DrCuriosity I recently refactored the code, now airnotifier is expecting mongodburi: https://github.com/airnotifier/airnotifier/blob/2.x/config.py-sample#L7 so we don't need to have extra auth options now.

I hope this makes sense.

DrCuriosity commented 4 years ago

Hi Dongsheng,

That sounds like a useful change; I will test it out on our instance tomorrow.

DrCuriosity commented 4 years ago

Hi, I just went to check this this morning, and the code refactor you mentioned yesterday does not seem to be there. Was there some kind of regression or reversion overnight?