Let developers remove themselves from apps.

This commit is contained in:
Logan Hanks
2012-07-25 11:13:12 -07:00
parent 432a0c3d33
commit 6ca678e013
2 changed files with 7 additions and 5 deletions

View File

@@ -2912,12 +2912,15 @@ class ApiController(RedditController, OAuth2ResourceController):
@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(),

View File

@@ -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>