Better fix, replacing [10294].

- Legacy-Id: 10296
Note: SVN reference [10294] has been migrated to Git commit c760822e04
This commit is contained in:
Henrik Levkowetz 2015-10-26 22:42:55 +00:00
parent c760822e04
commit 61ca4d2b5b
2 changed files with 2 additions and 4 deletions
ietf/meeting

View file

@ -575,7 +575,7 @@ def constraint_json(request, num, constraintid):
status = 404,
content_type="application/json")
json1 = constraint.json_dict(request)
json1 = constraint.json_dict(request.build_absolute_uri('/'))
return HttpResponse(json.dumps(json1, sort_keys=True, indent=2),
content_type="application/json")

View file

@ -849,9 +849,7 @@ class Constraint(models.Model):
def json_url(self):
return "/meeting/%s/constraint/%s.json" % (self.meeting.number, self.id)
def json_dict(self, request):
proto = 'https' if request.is_secure() else 'http'
host_scheme = "%s://%s" % (proto, request.get_host())
def json_dict(self, host_scheme):
ct1 = dict()
ct1['constraint_id'] = self.id
ct1['href'] = urljoin(host_scheme, self.json_url())