Skip to content

Commit

Permalink
Merge pull request #589 from CTPUG/bakery-buildable
Browse files Browse the repository at this point in the history
Handle PermissionDenied when building Users
  • Loading branch information
drnlm committed Jun 2, 2021
2 parents 304a8ac + 74799c2 commit 2114d7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wafer/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ def get_url(self, obj):
return reverse('wafer_user_profile', args=(obj.username,))

def build_object(self, obj):
"""Override django-bakery to skip profiles that raise 404"""
"""Override django-bakery to skip profiles that raise 403"""
try:
build_path = self.get_build_path(obj)
self.request = self.create_request(build_path)
self.request.user = AnonymousUser()
self.set_kwargs(obj)
self.build_file(build_path, self.get_content())
except Http404:
except PermissionDenied:
# cleanup directory
self.unbuild_object(obj)

Expand Down

0 comments on commit 2114d7b

Please sign in to comment.