All pastes #182175 Raw Edit

Anonymous

public python v1 · immutable
#182175 ·published 2006-09-25 20:12 UTC
rendered paste body
def update_profile_view(request):        try:            profile = UserProfile.objects.get(pk=request.user.id)            return update_object(                request,                model = UserProfile,                object_id = int(request.user.id),                #extra_context = { 'UserProfile': UserProfile._meta, },                login_required = True,                post_save_redirect = '/home/',            )        except UserProfile.DoesNotExist:            return create_object(                request,                model = UserProfile,                #extra_context = { 'UserProfile': UserProfile._meta, },                login_required = True,                post_save_redirect = '/home/',            )# The error message when trying to update an existing profile:ProgrammingError at /profile/ERROR: column "acis" does not exist SELECT 1 FROM "profiles_userprofile" WHERE "user_id"=acis LIMIT 1For some reason it's using the username instead of the user_id.