Tweak form handling for sending a new message, for more customization
This commit is contained in:
parent
70e5915e51
commit
051b52bd4b
4 changed files with 46 additions and 22 deletions
|
@ -209,6 +209,7 @@ class MessagesView(MasterView):
|
|||
if self.creating:
|
||||
form.id = 'new-message'
|
||||
form.cancel_url = self.request.get_referrer(default=self.request.route_url('messages.inbox'))
|
||||
form.create_label = "Send Message"
|
||||
return form
|
||||
|
||||
def configure_fieldset(self, fs):
|
||||
|
@ -288,6 +289,10 @@ class MessagesView(MasterView):
|
|||
message = form.fieldset.model
|
||||
message.sender = self.request.user
|
||||
|
||||
def flash_after_create(self, obj):
|
||||
self.request.session.flash("Message has been sent: {}".format(
|
||||
self.get_instance_title(obj)))
|
||||
|
||||
def filter_reply_recipient(self, user):
|
||||
return user.active
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue