mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-23 02:48:22 +02:00
Fix money creation, closes #25
This commit is contained in:
@ -41,17 +41,12 @@ class TransactionCreate(LoginRequiredMixin, CreateView):
|
||||
|
||||
if False: # TODO: fix it with "if %user has no right to transfer funds"
|
||||
del form.fields['source']
|
||||
form.user = self.request.user
|
||||
|
||||
return form
|
||||
|
||||
def form_valid(self, form):
|
||||
"""
|
||||
If the user has no right to transfer funds, then it will be the source of the transfer by default.
|
||||
"""
|
||||
if False: # TODO: fix it with "if %user has no right to transfer funds"
|
||||
form.instance.source = self.request.user.note
|
||||
|
||||
return super().form_valid(form)
|
||||
def get_success_url(self):
|
||||
return reverse('note:transfer')
|
||||
|
||||
|
||||
class NoteAutocomplete(autocomplete.Select2QuerySetView):
|
||||
|
Reference in New Issue
Block a user