Skip to content

Commit

Permalink
fixed ADMIN_ACCT issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dlareau committed Sep 9, 2015
1 parent 44b7cc2 commit 74049ec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions huntserver/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Is called usually after any modification to the submission
def send_submission_update(submission):
redis_publisher = RedisPublisher(facility='puzzle_submissions',
users=[submission.team.login_info.username, settings.ADMIN_ACCT])
users=[submission.team.login_info.username, settings.ADMIN_ACCTS[0]])
modelJSON = json.loads(serializers.serialize("json", [submission]))[0]
message = modelJSON['fields']
message['response_text'] = escape(message['response_text'])
Expand All @@ -32,7 +32,7 @@ def send_submission_update(submission):
def send_status_update(puzzle, team, status_type):
# status_type should be either "solve" or "unlock"
redis_publisher = RedisPublisher(facility='puzzle_status',
users=[team.login_info.username, settings.ADMIN_ACCT])
users=[team.login_info.username, settings.ADMIN_ACCTS[0]])
message = dict()
message['puzzle_id'] = puzzle.puzzle_id
message['puzzle_num'] = puzzle.puzzle_number
Expand All @@ -49,7 +49,7 @@ def send_status_update(puzzle, team, status_type):
# Displays a chat message to the relevant users
def send_chat_message(message):
redis_publisher = RedisPublisher(facility='chat_message',
users=[settings.ADMIN_ACCT, message.team.login_info.username])
users=[settings.ADMIN_ACCT[0], message.team.login_info.username])
packet = dict()
packet['team_pk'] = message.team.pk
packet['team_name'] = message.team.team_name
Expand All @@ -58,4 +58,4 @@ def send_chat_message(message):
df = DateFormat(message.time.astimezone(time_zone))
packet['time'] = df.format("h:i a")
packet = RedisMessage(json.dumps(packet))
redis_publisher.publish_message(packet)
redis_publisher.publish_message(packet)
3 changes: 2 additions & 1 deletion huntserver/templates/puzzle.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ <h3><a href='{{ STATIC_URL }}huntserver/puzzles/{{ puzzle.puzzle_id }}.pdf'>
url : $(this).attr('action') || window.location.pathname,
type: "POST",
data: $(this).serialize(),
error: function (jXHR, textStatus, errorThrown) {
error: function (jXHR, textStatus, errorThrown) {
console.log(jXHR.responseText);
alert(errorThrown);
}
});
Expand Down
2 changes: 1 addition & 1 deletion huntserver/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def registration(request):
else:
# Standard rendering of registration page
form = RegistrationForm()
teams = curr_hunt.team_set.all().exclude(team_name="Admin").order_by('team_name')
teams = curr_hunt.team_set.all().exclude(team_name="Admin").order_by('pk')
return render(request, "registration.html", {'form': form, 'teams': teams})

@login_required
Expand Down

0 comments on commit 74049ec

Please sign in to comment.