Révision d3cfbd19
Ajouté par Serghei Mihai (congés, retour 15/05) il y a presque 10 ans
calebasse/agenda/views.py | ||
---|---|---|
133 | 133 |
return context |
134 | 134 |
|
135 | 135 |
|
136 |
class NewAppointmentView(cbv.ReturnToObjectMixin, cbv.ServiceFormMixin, CreateView):
|
|
136 |
class NewAppointmentView(cbv.ServiceFormMixin, CreateView): |
|
137 | 137 |
model = EventWithAct |
138 | 138 |
form_class = NewAppointmentForm |
139 | 139 |
template_name = 'agenda/new-appointment.html' |
... | ... | |
150 | 150 |
initial['duration'] = self.request.GET.get('duration') |
151 | 151 |
return initial |
152 | 152 |
|
153 |
def get_form_kwargs(self): |
|
154 |
kwargs = super(NewAppointmentView, self).get_form_kwargs() |
|
155 |
kwargs['service'] = self.service |
|
156 |
return kwargs |
|
157 |
|
|
158 | 153 |
def get_success_url(self): |
159 | 154 |
return self.request.META.get('HTTP_REFERER', '..') |
160 | 155 |
|
161 | 156 |
def form_valid(self, form): |
157 |
obj = super(NewAppointmentView, self).form_valid(form) |
|
162 | 158 |
messages.add_message(self.request, messages.INFO, self.success_msg) |
163 |
return super(NewAppointmentView, self).form_valid(form)
|
|
159 |
return obj
|
|
164 | 160 |
|
165 | 161 |
|
166 | 162 |
class TodayOccurrenceMixin(object): |
Formats disponibles : Unified diff
actes: fixing empty EventWithAct object while trying to create an act. Doctors
are forced to be Worker instances instead of People(which is its parent)
Closes #4945