I have the following view:
def copy_group(request):
copy = request.GET.get('copy','')
if copy:
#do my copy process
context = {'view':'copy-view'}
return render(request, 'groups/copy-view.html', context)
This invoked with the following url mysite.com/groups/?copy=1
The problem is that if I refresh the page, my process keeps copying over and over.
How can I remove the ge parameter so the url returns after it copies: mysite.com/groups/
I tried inserting this in my view code:
request.GET.pop('copy')
But I get the error: This QueryDict instance is immutable