-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Directory: Enable option for getting notifications on new directory e…
…ntries If option is enabled in directory settings, people can now subscribe to a directory. Whenever said directory gets a new entry, subscribers get a notification email. TYPE: Feature LINK: OGC-1595
- Loading branch information
1 parent
6f7202c
commit 56de8c2
Showing
26 changed files
with
1,204 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
from functools import cached_property | ||
|
||
from wtforms import EmailField | ||
from onegov.core.utils import safe_format_keys, normalize_for_url | ||
from onegov.directory import DirectoryConfiguration | ||
from onegov.directory import DirectoryZipArchive | ||
|
@@ -28,6 +30,7 @@ | |
from wtforms.fields import TextAreaField | ||
from wtforms.validators import DataRequired | ||
from wtforms.validators import InputRequired | ||
from wtforms.validators import Email | ||
from wtforms.validators import Optional | ||
from wtforms.validators import ValidationError | ||
|
||
|
@@ -321,6 +324,12 @@ class DirectoryBaseForm(Form): | |
fieldset=_("Publication"), | ||
default=False) | ||
|
||
enable_update_notifications = BooleanField( | ||
label=_("Enable registering for update notifications"), | ||
description=_("Users can register for updates on new entries"), | ||
fieldset=_("Notifications"), | ||
default=False) | ||
|
||
required_publication = BooleanField( | ||
label=_("Required publication dates"), | ||
fieldset=_("Publication"), | ||
|
@@ -766,3 +775,13 @@ def validate_name(self, field: StringField) -> None: | |
raise ValidationError( | ||
_("An entry with the same name exists") | ||
) | ||
|
||
|
||
class DirectoryRecipientForm(Form): | ||
"""Form for adding recipients of entry updates to the directory.""" | ||
|
||
address = EmailField( | ||
label=_("E-Mail"), | ||
description="[email protected]", | ||
validators=[InputRequired(), Email()] | ||
) |
Oops, something went wrong.