Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pieapple committed Jul 9, 2012
1 parent b1b3367 commit 9168701
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
32 changes: 16 additions & 16 deletions src/etraining/admin_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,17 +361,17 @@ def view_training_signup(request, group_id, training_id):
if new_group == group or new_group.parent_group == group:
employee_list.extend(new_group.employee_set.all())
for employee in employee_list:
try:
record = EmployeeTrainingRecord.objects.get(employee=employee, training=training)
except:
record = None
try:
record = EmployeeTrainingRecord.objects.get(employee=employee, training=training)
except:
record = None

if not record:
employee.status = 0
elif not record.score or record.score < training.pass_criteria:
employee.status = 1
else:
employee.status = 2
if not record:
employee.status = 0
elif not record.score or record.score < training.pass_criteria:
employee.status = 1
else:
employee.status = 2
else:
groups = Group.objects.filter(is_employee_group=False)
for new_group in groups:
Expand Down Expand Up @@ -399,12 +399,12 @@ def view_training_signup(request, group_id, training_id):
nonemployee.status = 1
else:
nonemployee.status = 2
return render_to_response("etraining/admin/view_training_signup.html", {
"training": training,
"group": group,
"employee_list": employee_list,
"nonemployee_list": nonemployee_list,
}, context_instance=RequestContext(request))
return render_to_response("etraining/admin/view_training_signup.html", {
"training": training,
"group": group,
"employee_list": employee_list,
"nonemployee_list": nonemployee_list,
}, context_instance=RequestContext(request))

@login_required
def view_employee_training(request):
Expand Down
Binary file modified src/locale/zh_CN/LC_MESSAGES/django.mo
Binary file not shown.
4 changes: 3 additions & 1 deletion src/locale/zh_CN/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,10 @@ msgstr "查看临时工培训"
#: templates/etraining/admin/view_vendor_training.html:11
#: templates/etraining/admin/view_visitor_entrance.html:11
msgid "view visitor entrance"
msgstr "查看入厂记录"
msgstr "查看访客入厂记录"

msgid "view vendor entrance"
msgstr "查看临时工入厂记录"
#: templates/etraining/admin/manage_documents.html:12
#: templates/etraining/admin/manage_question_poll.html:12
#: templates/etraining/admin/view_employee_training.html:12
Expand Down
2 changes: 1 addition & 1 deletion src/templates/etraining/admin/view_vendor_entrance.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

{% block content %}
<div class="content clearfix">
<div class="content_title">{% trans "View Vendor Entrance" %}</div>
<div class="content_title">{% trans "view vendor entrance" %}</div>
<table cellpadding="0" cellspacing="0" border="0" class="dataTable" width="100%">
<thead>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/etraining/admin/view_visitor_entrance.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

{% block content %}
<div class="content clearfix">
<div class="content_title">{% trans "View Visitor Entrance" %}</div>
<div class="content_title">{% trans "view visitor entrance" %}</div>
<table cellpadding="0" cellspacing="0" border="0" class="dataTable" width="100%">
<thead>
<tr>
Expand Down

0 comments on commit 9168701

Please sign in to comment.