Skip to content

Commit

Permalink
stupid leave org
Browse files Browse the repository at this point in the history
  • Loading branch information
leduythuccs committed Dec 10, 2024
1 parent 4308eee commit 3cc0f31
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions judge/views/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,7 @@ def handle(self, request, org, profile):

class LeaveOrganization(OrganizationMembershipChange):
def handle(self, request, org, profile):
if not profile.organizations.filter(id=org.id).exists():
return generic_message(request, _('Leaving organization'), _('You are not in "%s".') % org.short_name)
if org.is_admin(profile):
return generic_message(request, _('Leaving organization'), _('You cannot leave an organization you own.'))
profile.organizations.remove(org)
return generic_message(request, _('Leaving organization'), _('ARE YOU STUPID?'))


class OrganizationRequestForm(Form):
Expand Down

0 comments on commit 3cc0f31

Please sign in to comment.