views.py
def edit_report(request, report_id):
user = request.user
if 'report_id' in request.session:
del request.session['report_id']
try:
member = Members.objects.get(member=user)
account_user = member.user
except:
account_user = user.id
request.session['report_id'] = report_id
request.session['account_user'] = account_user
request.session["edit_report"] = True
return redirect('method_name')
When a button is clicked in my application, it leads to the edit_report method. If the session variable request.session["edit_report"]
becomes true during this process (set with
request.session["edit_report"] = True
), I would like to use JavaScript to check for this condition and then display a hidden div by setting its style to "display: inline". How can I achieve this using Django?