Fix: don't send mail if no news [task 2, status:done]

This commit is contained in:
2020-07-04 01:03:26 +02:00
parent 503e36e0d3
commit bd5bf11661
2 changed files with 7 additions and 0 deletions

View File

@@ -37,6 +37,9 @@ I wrote this script really quickly, certainly faster than this README. So I alre
* The script sends mail even if no new projets or release has been detected * The script sends mail even if no new projets or release has been detected
* The biggest, you have to edit script to specify absolute path... * The biggest, you have to edit script to specify absolute path...
* A lot of other little problems, like the code that's disgusting and so on. * A lot of other little problems, like the code that's disgusting and so on.
For who's asking: yes, it's normal that I have put all code in one main function [like a blind gunner.](https://media.giphy.com/media/1yMexL5rkwYhuiVEmZ/giphy.gif). Really quickly I said!
But overall, the script works and sends mail! But overall, the script works and sends mail!
Hey boy, what is the `pit.db` file? Hey boy, what is the `pit.db` file?

View File

@@ -42,6 +42,10 @@ def main():
new_releases.append(last_release) new_releases.append(last_release)
parser.set('release', project, last_release['release_tag']) parser.set('release', project, last_release['release_tag'])
if not new_releases and not new_projects:
print('No new projets or new release detected. Bye!')
return
content = "" content = ""
for new_r in new_releases: for new_r in new_releases: