Skip to content

Commit

Permalink
On the view, not the form...
Browse files Browse the repository at this point in the history
  • Loading branch information
dbuxton committed Mar 3, 2014
1 parent 630e40a commit 1288eb2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/cabotapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,6 @@ class Meta:
)
widgets = dict(**base_widgets)

def form_valid(self, form):
# We want to update Jenkins statuses once a minute
form.instance.frequency = 1
return super(JenkinsStatusCheckForm, self).form_valid(form)


class UserProfileForm(forms.ModelForm):

Expand Down Expand Up @@ -302,11 +297,19 @@ class JenkinsCheckCreateView(CheckCreateView):
model = JenkinsStatusCheck
form_class = JenkinsStatusCheckForm

def form_valid(self, form):
form.instance.frequency = 1
return super(JenkinsStatusCheckView, self).form_valid(form)


class JenkinsCheckUpdateView(CheckUpdateView):
model = JenkinsStatusCheck
form_class = JenkinsStatusCheckForm

def form_valid(self, form):
form.instance.frequency = 1
return super(JenkinsStatusCheckView, self).form_valid(form)


class StatusCheckListView(LoginRequiredMixin, ListView):
model = StatusCheck
Expand Down

0 comments on commit 1288eb2

Please sign in to comment.