Exemple #1
0
def set_coordinates(request):
    form = AccountSetGCoordinates(
        request.POST or None,
        instance=request.user)
    if request.method == 'POST':
        if form.is_valid():
            form.save()
    return {'form': form}
Exemple #2
0
def purge_coordinates(request):
    request.user.glat = None
    request.user.glng = None
    request.user.save()

    form = AccountSetGCoordinates(
        request.POST or None,
        instance=request.user)
    if request.method == 'POST':
        if form.is_valid():
            form.save()
    return {'form': form}