Here is the code and Im wondering how can I make it so it saves if the input from the form is unique and not already in the db.
@login_required
def settings(request):
form = EmailInfoForm()
if request.method == "POST":
form = EmailInfoForm(request.POST)
if form.is_valid():
form.save()
context = {'form': form}
return render(request, 'tasks/settings.html', context)