mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 13:32:15 +00:00
Fixed edit always being invalid due to always failing form validation
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
{% if duplicate %}
|
||||
{% render_field form.asset_id|add_class:'form-control' value=object.asset_id %}
|
||||
{% elif object.asset_id %}
|
||||
{% render_field form.asset_id|attr:'readonly disabled'|add_class:'disabled_input form-control' value=object.asset_id %}
|
||||
{% render_field form.asset_id|attr:'readonly'|add_class:'disabled_input form-control' value=object.asset_id %}
|
||||
{% else %}
|
||||
{% render_field form.asset_id|add_class:'form-control' %}
|
||||
{% endif %}
|
||||
|
||||
@@ -60,8 +60,6 @@ class AssetEdit(LoginRequiredMixin, generic.UpdateView):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(AssetEdit, self).get_context_data(**kwargs)
|
||||
if self.kwargs:
|
||||
context['object'] = get_object_or_404(models.Asset, pk=self.kwargs['pk'])
|
||||
context['form'] = forms.AssetForm
|
||||
# context['asset_names'] = models.Asset.objects.values_list('asset_id', 'description').order_by('-date_acquired')[]
|
||||
|
||||
@@ -70,7 +68,6 @@ class AssetEdit(LoginRequiredMixin, generic.UpdateView):
|
||||
return context
|
||||
|
||||
def form_invalid(self, form):
|
||||
print(form.errors)
|
||||
return super().form_invalid(form)
|
||||
|
||||
def get_success_url(self):
|
||||
|
||||
Reference in New Issue
Block a user