Commit 2ef3c026 authored by Sli's avatar Sli

Fix error on accounting when no target_type specified

parent 7cb9ea40
Pipeline #939 passed with stage
in 4 minutes and 19 seconds
......@@ -304,6 +304,7 @@ class OperationForm(forms.ModelForm):
def clean(self):
self.cleaned_data = super(OperationForm, self).clean()
if 'target_type' in self.cleaned_data.keys():
if self.cleaned_data['target_type'] == "USER":
self.cleaned_data['target_id'] = self.cleaned_data['user'].id
elif self.cleaned_data['target_type'] == "ACCOUNT":
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment