Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.14.x into central-develop #4161

Merged
merged 4 commits into from
Jul 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion kalite/coachreports/api_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def detail_uri_kwargs(self, bundle_or_obj):
return kwargs

def obj_get_list(self, bundle, **kwargs):
self.permission_check(bundle.request)
return self.get_object_list(bundle.request)


Expand Down
13 changes: 10 additions & 3 deletions kalite/coachreports/static/js/coachreports/coach_reports/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,17 @@ var GroupSelectView = Backbone.View.extend({
}));

var id = this.model.get("group");
var output, ref;
// This nonsense of 'id' not being the Backbone 'id' is because of tastypie Resource URLs being used as model ids
this.model.set({
"group_name": this.group_list.find(function(model){ return model.get("id") === id;}).get("name")
});
output = (ref = this.group_list.find(function(model) {
return model.get("id") === id;
})) != null ? ref.get("name") : void 0;

if (output) {
this.model.set({
"group_name": output
});
}

return this;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h2>
<td>
{% if group.id %}
{# Translators: this is a verb; by clicking this link, the user will be able to coach students. #}
<a title="{% blocktrans with groupname=group.name %}Coach group {{ groupname }}.{% endblocktrans %}" href="{% url 'coach_reports' %}/{{ facility_id }}/{{ group.id }}/">
<a title="{% blocktrans with groupname=group.name %}Coach group {{ groupname }}.{% endblocktrans %}" href="{% url 'coach_reports' %}{{ facility_id }}/{{ group.id }}/">
<div class="sparklines" sparkType="bar" sparkBarColor="green">
<!--
{{ group.total_logins }},
Expand Down
6 changes: 5 additions & 1 deletion kalite/facility/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ def _facility_user(request, facility, title, is_teacher=False, new_user=False, u
# New user created by admin
elif request.is_admin or request.is_django_user:
messages.success(request, _("You successfully created user '%(username)s'") % {"username": form.instance.get_name()})
return HttpResponseRedirect(reverse("facility_management", kwargs={"zone_id": None, "facility_id": facility.id}))
if request.next:
return HttpResponseRedirect(next)
else:
zone_id = facility.get_zone().getattr(id, None)
return HttpResponseRedirect(reverse("facility_management", kwargs={"zone_id": zone_id, "facility_id": facility.id}))

# New student signed up
else:
Expand Down