fnp
/
edumed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
exercises in .gitignore
[edumed.git]
/
wtem
/
management
/
commands
/
wtem_send_results.py
diff --git
a/wtem/management/commands/wtem_send_results.py
b/wtem/management/commands/wtem_send_results.py
index
c0da6fd
..
c443ed1
100644
(file)
--- a/
wtem/management/commands/wtem_send_results.py
+++ b/
wtem/management/commands/wtem_send_results.py
@@
-13,9
+13,9
@@
from wtem.models import Submission
def get_submissions():
def get_submissions():
- return
Submission.objects.exclude(answers = None).all(
)
+ return
sorted(Submission.objects.exclude(answers = None).all(), key=lambda s: -s.final_result
)
-minimum =
47.
5
+minimum =
5
5
class Command(BaseCommand):
class Command(BaseCommand):
@@
-47,7
+47,7
@@
class Command(BaseCommand):
def handle_to_students(self, *args, **options):
self.stdout.write('>>> Sending results to students')
def handle_to_students(self, *args, **options):
self.stdout.write('>>> Sending results to students')
- subject = '
Twój wynik w I etapie
Wielkiego Turnieju Edukacji Medialnej'
+ subject = '
Wyniki I etapu
Wielkiego Turnieju Edukacji Medialnej'
for submission in get_submissions():
if options['only_to'] and submission.email != options['only_to']:
for submission in get_submissions():
if options['only_to'] and submission.email != options['only_to']:
@@
-64,7
+64,7
@@
class Command(BaseCommand):
def handle_to_teachers(self, *args, **options):
self.stdout.write('>>> Sending results to teachers')
def handle_to_teachers(self, *args, **options):
self.stdout.write('>>> Sending results to teachers')
- subject = 'Wyniki
Twoich uczniów w I etapie
Wielkiego Turnieju Edukacji Medialnej'
+ subject = 'Wyniki
I etapu
Wielkiego Turnieju Edukacji Medialnej'
failed = sent = 0
submissions_by_contact = dict()
failed = sent = 0
submissions_by_contact = dict()
@@
-92,7
+92,7
@@
class Command(BaseCommand):
body = message,
to = [email]
)
body = message,
to = [email]
)
- except:
+ except
BaseException, e
:
self.failed += 1
self.stdout.write('failed sending to: ' + email + ': ' + str(e))
else:
self.failed += 1
self.stdout.write('failed sending to: ' + email + ': ' + str(e))
else: