Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions atom/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ class SingleButtonMixin(HelperMixin):

@property
def action_text(self):
return _('Update') if hasattr(self, 'instance') and self.instance.pk else _('Save')
return _('Update') if (hasattr(self, 'instance') and
self.instance.pk) else _('Save'

def __init__(self, *args, **kwargs):
super(SingleButtonMixin, self).__init__(*args, **kwargs)
self.helper.add_input(Submit('action', self.action_text, css_class="btn-primary"))
self.helper.add_input(
Submit('action', self.action_text, css_class="btn-primary"))


class SaveButtonMixin(SingleButtonMixin):
Expand Down