Skip to content

Commit

Permalink
fix mozilla#123 - fixing edit entry url - returning a reference to th…
Browse files Browse the repository at this point in the history
…e submission_parent opposed to the old submission URL
  • Loading branch information
rossbruniges committed Jan 18, 2013
1 parent 995c4f1 commit 5886604
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions apps/challenges/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,15 +413,20 @@ def phase_slug(self):
return 'apps'

def get_absolute_url(self):
"""Return this submission's URL."""
"""
Return this submission's URL
"""
if self.parent_slug and self.phase_slug:
return self._lookup_url('entry_show', {'entry_id': self.parent_slug,
'phase': self.phase_slug})
return u''

def get_edit_url(self):
"""Return the URL to edit this submission."""
return self._lookup_url('entry_edit', {'pk': self.id,
"""
Return the URL to edit this submission, we need to use the submission
parent as that is what holds the key of which submission to edit
"""
return self._lookup_url('entry_edit', {'pk': self.parent_slug,
'phase': self.phase_slug})

def get_delete_url(self):
Expand Down

0 comments on commit 5886604

Please sign in to comment.