Skip to content

Commit

Permalink
Add to Group table when operator creates Group
Browse files Browse the repository at this point in the history
  • Loading branch information
sammachin committed May 8, 2024
1 parent 6da4e07 commit 5ad0d11
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions oper/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def create_number(request):
form.instance.user = request.user
if form.is_valid():
form.save()
tosGroupObj = TypeOfService.objects.get(name='Group')
if form.cleaned_data['typeofservice'] == tosGroupObj:
n = Number.objects.get(pk=form.cleaned_data['value'])
Group.objects.create(value=n, event=form.cleaned_data['event'], user=form.instance.user)
publish('add', form.cleaned_data['value'], form.cleaned_data['typeofservice'])
return redirect('/operator/number')
else:
Expand Down

0 comments on commit 5ad0d11

Please sign in to comment.