Fix a bug in meeting.ajax.constraint_json().
- Legacy-Id: 10294
This commit is contained in:
parent
e3ea4d8f37
commit
c760822e04
|
@ -575,7 +575,7 @@ def constraint_json(request, num, constraintid):
|
|||
status = 404,
|
||||
content_type="application/json")
|
||||
|
||||
json1 = constraint.json_dict(request.get_host_protocol())
|
||||
json1 = constraint.json_dict(request)
|
||||
return HttpResponse(json.dumps(json1, sort_keys=True, indent=2),
|
||||
content_type="application/json")
|
||||
|
||||
|
|
|
@ -849,7 +849,9 @@ class Constraint(models.Model):
|
|||
def json_url(self):
|
||||
return "/meeting/%s/constraint/%s.json" % (self.meeting.number, self.id)
|
||||
|
||||
def json_dict(self, host_scheme):
|
||||
def json_dict(self, request):
|
||||
proto = 'https' if request.is_secure() else 'http'
|
||||
host_scheme = "%s://%s" % (proto, request.get_host())
|
||||
ct1 = dict()
|
||||
ct1['constraint_id'] = self.id
|
||||
ct1['href'] = urljoin(host_scheme, self.json_url())
|
||||
|
|
Loading…
Reference in a new issue