Fixed an issue

- Changed owner -> user
   - Reformatted code
This commit is contained in:
M.Ravi 2017-08-04 17:49:35 +02:00
parent c6b23f6aa0
commit d85afd56e0

View file

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