Fixed an issue
- Changed owner -> user - Reformatted code
This commit is contained in:
parent
c6b23f6aa0
commit
d85afd56e0
1 changed files with 8 additions and 6 deletions
|
@ -343,9 +343,11 @@ class SSHKeyDeleteView(LoginRequiredMixin, DeleteView):
|
|||
model = UserHostingKey
|
||||
|
||||
def get_object(self, queryset=None):
|
||||
""" Hook to ensure object is owned by request.user. """
|
||||
""" Hook to ensure UserHostingKey object is owned by request.user.
|
||||
We reply with a Http404 if the user is not the owner of the key.
|
||||
"""
|
||||
obj = super(SSHKeyDeleteView, self).get_object()
|
||||
if not obj.owner == self.request.user:
|
||||
if not obj.user == self.request.user:
|
||||
raise Http404
|
||||
return obj
|
||||
|
||||
|
|
Loading…
Reference in a new issue