|
@ -1619,14 +1619,13 @@ class MateriaLegislativaCrud(Crud): |
|
|
|
|
|
|
|
|
form_class = MateriaLegislativaForm |
|
|
form_class = MateriaLegislativaForm |
|
|
|
|
|
|
|
|
def form_valid(self, form): |
|
|
def get_initial(self): |
|
|
self.object = form.instance |
|
|
initial = super(CreateView, self).get_initial() |
|
|
|
|
|
|
|
|
self.object.user = self.request.user |
|
|
initial['user'] = self.request.user |
|
|
self.object.ip = get_client_ip(self.request) |
|
|
initial['ip'] = get_client_ip(self.request) |
|
|
self.object.save() |
|
|
|
|
|
|
|
|
|
|
|
return super().form_valid(form) |
|
|
return initial |
|
|
|
|
|
|
|
|
@property |
|
|
@property |
|
|
def cancel_url(self): |
|
|
def cancel_url(self): |
|
|