mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 23:39:11 -05:00
Let developers remove themselves from apps.
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -32,10 +32,9 @@
|
||||
${dev.name} 
|
||||
%if c.user == dev:
|
||||
<span class="gray">${_("(that's you!)")}</span> 
|
||||
%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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user