Skip to content

Commit

Permalink
Update to have consistent namespacing
Browse files Browse the repository at this point in the history
  • Loading branch information
paltman committed Jul 13, 2012
1 parent 223b60d commit ff67098
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion privileges/models.py
Expand Up @@ -11,7 +11,7 @@


grants = import_module(
getattr(settings, "PRIVILEGES_GRANTS_MODULE", "delegation.grants")
getattr(settings, "PRIVILEGES_GRANTS_MODULE", "privileges.grants")
)


Expand Down
10 changes: 5 additions & 5 deletions privileges/urls.py
Expand Up @@ -2,11 +2,11 @@


urlpatterns = patterns(
"delegation.views",
url(r"^(?P<username>\w+)/$", "list",
name="delegation_list"
"privileges.views",
url(r"^(?P<username>\w+)/$", "grant_list",
name="privileges_grant_list"
),
url(r"^(?P<username>\w+)/(?P<pk>\d+)/$", "detail",
name="delegation_detail"
url(r"^(?P<username>\w+)/(?P<pk>\d+)/$", "grant_detail",
name="privileges_grant_detail"
)
)
10 changes: 5 additions & 5 deletions privileges/views.py
Expand Up @@ -8,7 +8,7 @@
from privileges.models import Grant


def list(request, username):
def grant_list(request, username):

user = get_object_or_404(User, username=username)
if request.user != user and not request.user.is_superuser:
Expand All @@ -18,19 +18,19 @@ def list(request, username):
form = GrantForm(request.POST, user=request.user)
if form.is_valid():
form.save()
redirect("delegation_list", username=username)
redirect("privileges_grant_list", username=username)
else:
form = GrantForm(user=request.user)

return render_to_response("delegation/list.html", {
return render_to_response("privileges/grant_list.html", {
"grants_given": Grant.objects.filter(grantor=user),
"grants_received": Grant.objects.filter(grantee=user),
"grant_user": user,
"form": form
}, context_instance=RequestContext(request))


def detail(request, username, pk):
def grant_detail(request, username, pk):

user = get_object_or_404(User, username=username)
if request.user != user and not request.user.is_superuser:
Expand All @@ -40,7 +40,7 @@ def detail(request, username, pk):
if grant.grantor != user and grant.grantee != user:
return Http404()

return render_to_response("delegation/detail.html", {
return render_to_response("privileges/grant_detail.html", {
"grant": grant,
"grant_user": user
}, context_instance=RequestContext(request))

0 comments on commit ff67098

Please sign in to comment.