Exemplo n.º 1
0
def edit_profile(request):
    instance = request.user.profile
    form = ProfileForm(instance=instance)
    if request.method == 'POST':
        form = ProfileForm(request.POST, instance=instance)
        if form.is_valid():
            form.save()
            request.session['django_language'] = core.get_current_user().profile.language
            return redirect(reverse('admin_topics'))

    return render(request, 'core/profiles/edit.html', {'form': form})
Exemplo n.º 2
0
 def save(self, *args, **kwargs):
     self.saved_by = core.get_current_user()
     super(Topic, self).save(*args, **kwargs)