Skip to content

Commit

Permalink
Org: Only sends directory entry notifications for public entries
Browse files Browse the repository at this point in the history
TYPE: Bugfix
LINK: OGC-1806
  • Loading branch information
Daverball committed Sep 11, 2024
1 parent 5cb2d88 commit ad50b43
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/onegov/org/views/directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,17 +588,23 @@ def handle_new_directory_entry(
) -> 'RenderData | Response':

if form.submitted(request):
entry: ExtendedDirectoryEntry
try:
entry = self.directory.add_by_form(form, type=(
'extended'))
entry = self.directory.add_by_form( # type:ignore[assignment]
form,
type='extended'
)
except DuplicateEntryError as e:
request.alert(_("The entry ${name} exists twice", mapping={
'name': e.name
}))
transaction.abort()
return request.redirect(request.link(self))

if self.directory.enable_update_notifications:
if self.directory.enable_update_notifications and entry.access in (
'public',
'mtan'
):
title = request.translate(_(
'${org}: New Entry in "${directory}"',
mapping={'org': request.app.org.title,
Expand Down

0 comments on commit ad50b43

Please sign in to comment.