Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Let developers remove themselves from apps.
Browse files Browse the repository at this point in the history
  • Loading branch information
Logan Hanks committed Aug 22, 2012
1 parent 432a0c3 commit 6ca678e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 5 additions & 2 deletions r2/r2/controllers/api.py
Expand Up @@ -2912,12 +2912,15 @@ def POST_adddeveloper(self, form, jquery, client, account):
@validatedForm(VUser(),
VModhash(),
client=VOAuth2ClientDeveloper(),
account=VExistingUnameNotSelf('name'))
account=VExistingUname('name'))
@api_doc(api_section.apps)
def POST_removedeveloper(self, form, jquery, client, account):
if client and account and not form.has_errors('name'):
client.remove_developer(account)
jquery('li#app-dev-%s-%s' % (client._id, account._id)).fadeOut()
if account._id == c.user._id:
jquery('#developed-app-%s' % client._id).fadeOut()
else:
jquery('li#app-dev-%s-%s' % (client._id, account._id)).fadeOut()

@noresponse(VUser(),
VModhash(),
Expand Down
5 changes: 2 additions & 3 deletions r2/r2/templates/prefapps.html
Expand Up @@ -32,10 +32,9 @@
${dev.name} 
%if c.user == dev:
<span class="gray">${_("(that's you!)")}</span>&#32;
%else:
${ajax_ynbutton(_("remove"), "removedeveloper",
hidden_data=dict(client_id=app._id, name=dev.name))}
%endif
${ajax_ynbutton(_("remove"), "removedeveloper",
hidden_data=dict(client_id=app._id, name=dev.name))}
</li>
</%def>

Expand Down

0 comments on commit 6ca678e

Please sign in to comment.