Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #55 from ednapiranha/bug741593

force cache update; fix bug 741593
  • Loading branch information...
commit 375c22305308200b5fcdf43d54bf94c1fbdfec5c 2 parents eaa75b8 + 5af9fa7
@ednapiranha ednapiranha authored
Showing with 11 additions and 2 deletions.
  1. +4 −1 apps/projects/views.py
  2. +7 −1 apps/users/views.py
View
5 apps/projects/views.py
@@ -1,4 +1,5 @@
import json
+import os
from django.contrib import messages
from django.contrib.auth.decorators import login_required
@@ -134,7 +135,9 @@ def get_context_data(self, **kwargs):
return super(EditProjectView, self).get_context_data(**kwargs)
def get_success_url(self):
- return self.object.get_absolute_url()
+ """Need to force a cache update so the changes are displayed."""
+ page_update = os.urandom(3).encode('hex')
+ return '%s?%s' % (self.object.get_absolute_url(), page_update)
class DeleteProjectLinkView(View):
View
8 apps/users/views.py
@@ -1,4 +1,5 @@
import json
+import os
from django.contrib import auth, messages
from django.contrib.auth.decorators import login_required
@@ -117,7 +118,12 @@ def edit(request):
link = links_form.save(commit=False)
link.profile = profile
link.save()
- return redirect(profile)
+ # Need to force a cache update so the changes are displayed.
+ page_update = os.urandom(3).encode('hex')
+ update_url = '%s?%s' % (reverse('users_profile',
+ kwargs={ 'username': profile.user.username }),
+ page_update)
+ return redirect(update_url)
else:
form = form_class(instance=profile)
links = profile.link_set.all()
Please sign in to comment.
Something went wrong with that request. Please try again.