summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2014-02-21 13:15:13 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2014-02-21 13:15:13 (GMT)
commit9717981b234728b71f1d08947748d484de6dcbcc (patch)
tree0f1711c8366dab100af929f4c78b7bbbff75b7f5
parent9ca705a905fefd2930bb9518b74bf42f72c33189 (diff)
downloadpolynum-blackboard-master.zip
polynum-blackboard-master.tar.gz
polynum-blackboard-master.tar.bz2
send-to-mycourse: skip push without a request objectHEADmaster
-rw-r--r--polynum_blackboard/management/commands/send-to-mycourse.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/polynum_blackboard/management/commands/send-to-mycourse.py b/polynum_blackboard/management/commands/send-to-mycourse.py
index 327b47b..69f379e 100644
--- a/polynum_blackboard/management/commands/send-to-mycourse.py
+++ b/polynum_blackboard/management/commands/send-to-mycourse.py
@@ -27,9 +27,9 @@ class Command(BaseCommand):
@transaction.commit_on_success
def handle(self, *args, **options):
logger = logging.getLogger(__name__)
- bb_pushs = models.BlackBoardPush.objects.filter(sent=False)
+ bb_pushs = models.BlackBoardPush.objects.filter(sent=False, request__isnull=False)
if options['delete']:
- qs = models.BlackBoardPush.objects.filter(id__in=options['delete'].split(','), request__isnull=Falsoe)
+ qs = models.BlackBoardPush.objects.filter(id__in=options['delete'].split(','))
for push in qs:
print ' - deleted push request %s for document %s' % (push.id, push.request.id)
qs.delete()