summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Leray <alexandre@alexandreleray.com>2010-11-04 21:34:35 (GMT)
committer Alexandre Leray <alexandre@alexandreleray.com>2010-11-04 21:34:35 (GMT)
commitd36d7ab3f57938a2bee6d20bda429ac6888c6bac (patch)
treedbde947dd42d3f02d1e04a6d04545b2ee8439972
parent12b3927e206facc1cb92c1da4627995c7bbf0a25 (diff)
fixing pull request error because of non slug
-rw-r--r--brainch/templates/brainch/pull-request.html4
-rwxr-xr-xbrainch/views/repositories/pull_request.py2
-rwxr-xr-xbrainch/views/utils.py2
3 files changed, 4 insertions, 4 deletions
diff --git a/brainch/templates/brainch/pull-request.html b/brainch/templates/brainch/pull-request.html
index 3008da7..9ec3eb2 100644
--- a/brainch/templates/brainch/pull-request.html
+++ b/brainch/templates/brainch/pull-request.html
@@ -5,8 +5,8 @@
{% block sidebar %}
<ul class="tools">
- <li>&#8620; <a href='{% url brainch-view repo.user repo.name %}'>Read latest version</a></li>
- <li>&#8619; <a href='{% url brainch-history repo.user repo.name %}'>History of the text</a></li>
+ <li>&#8620; <a href='{% url brainch-view repo.user repo.slug %}'>Read latest version</a></li>
+ <li>&#8619; <a href='{% url brainch-history repo.user repo.slug %}'>History of the text</a></li>
</ul>
{% endblock sidebar %}
diff --git a/brainch/views/repositories/pull_request.py b/brainch/views/repositories/pull_request.py
index 68bb09f..e97f9ec 100755
--- a/brainch/views/repositories/pull_request.py
+++ b/brainch/views/repositories/pull_request.py
@@ -34,7 +34,7 @@ def pull_request(request, username, name):
"""
Send to one's mates a request for pull
"""
- repo = Repository.objects.get(name=name, user__username=username)
+ repo = Repository.objects.get(slug=name, user__username=username)
if request.method == 'POST': # If the form has been submitted...
form = PullRequestForm(request.POST, mates=get_mate_repos(username, name), prospects=get_mate_repos(username, name, invert=True)) # A form bound to the POST data
if form.is_valid():
diff --git a/brainch/views/utils.py b/brainch/views/utils.py
index 75a1b3f..6bc76fa 100755
--- a/brainch/views/utils.py
+++ b/brainch/views/utils.py
@@ -51,7 +51,7 @@ def get_mate_repos(username, name, invert=False):
mates = []
prospects= []
# List of users already sharing a copy
- clone_list = Repository.objects.filter(name=name).exclude(user__username=username)
+ clone_list = Repository.objects.filter(slug=name).exclude(user__username=username)
for clone in clone_list:
mates.append((clone.user.email, u"%s (%s)" % (clone.user.username, clone.user.email)))
# List of the other users