Fix incorrect code to get the deployment name

(imported from commit 134ffafc4b15da77b0bb5ffc84766a3fb4099ae2)
This commit is contained in:
Kevin Mehall 2013-11-13 11:16:31 -05:00
parent 1cb339a23d
commit 3ec7663cb2
2 changed files with 9 additions and 1 deletions

View File

@ -18,3 +18,11 @@ class Deployment(models.Model):
@property
def endpoints(self):
return {'base_api_url': self.base_api_url, 'base_site_url': self.base_site_url}
@property
def name(self):
# TODO: This only does the right thing for prod because prod authenticates to
# staging with the zulip.com deployment key, while staging is technically the
# deployment for the zulip.com realm.
# This also doesn't necessarily handle other multi-realm deployments correctly.
return self.realms.order_by('pk')[0].domain

View File

@ -27,7 +27,7 @@ def get_ticket_number():
def submit_feedback(request, deployment, message=REQ(converter=json_to_dict)):
domainish = message["sender_domain"]
if get_realm("zulip.com") not in deployment.realms.all():
domainish += " via " + deployment.realms.get(0).domain
domainish += " via " + deployment.name
subject = "feedback: %s (%s)" % (message["sender_email"], domainish)
if len(subject) > 60: