make sure to exit send_moderation_email when there is no renkan to moderate
authorymh <ymh.work@gmail.com>
Fri, 03 Jul 2015 00:19:58 +0200
changeset 634 6bdb0e1c0b84
parent 633 bc639e8d3a4c
child 635 73d195640287
make sure to exit send_moderation_email when there is no renkan to moderate
src/hdalab/management/commands/send_moderation_mail.py
--- a/src/hdalab/management/commands/send_moderation_mail.py	Thu Jul 02 19:49:14 2015 +0200
+++ b/src/hdalab/management/commands/send_moderation_mail.py	Fri Jul 03 00:19:58 2015 +0200
@@ -37,6 +37,8 @@
         
         if renkan_count == 0:
             logger.info("Send moderation email : no renkan to moderate. exiting")
+            return
+
         logger.debug("Send moderation email : %d renkan(s) to moderate", renkan_count)
         
         renkan_list = list(renkan_query.select_related()[:20])