def default_dashboard(request): dashboards = personal_dashboards(request) if len(dashboards) > 0: # Redirect to the first dashboard return HttpResponseRedirect(dashboards[0].get_absolute_url()) else: # Redirect to the profile page return HttpResponseRedirect(profile_url(request.user))
def __init__(self, action): title = _(u'<a href="{profile_url}">{user}</a> answered ' u'<a href="{answer_url}">{question}</a>') self.action = action self.answer = action.content_object self.title = fe(title, profile_url=profile_url(self.action.creator), user=display_name(self.action.creator), answer_url=self.action.url, question=self.answer.question.title) # 225 - determined by experiment. self.content = self.answer.content[0:255]
def __init__(self, action): title = _(u'<a href="{profile_url}">{user}</a> replied to ' u'<a href="{post_url}">{thread}</a>') self.action = action self.post = action.content_object self.title = fe(title, profile_url=profile_url(self.action.creator), user=display_name(self.action.creator), post_url=self.action.url, thread=self.post.thread.title) # 225 was determined by experiment. Feel free to change if the # layout changes. self.content = self.post.content[0:225]
def __init__(self, action): title = _(u'<a href="{profile_url}">{user}</a> answered ' u'<a href="{answer_url}">{question}</a>') self.action = action self.answer = action.content_object self.title = fe( title, profile_url=profile_url(self.action.creator), user=display_name(self.action.creator), answer_url=self.action.url, question=self.answer.question.title, ) # 225 - determined by experiment. self.content = self.answer.content[0:255]
def test_profile_url(self): eq_(u'/user/%d' % self.u.id, profile_url(self.u))
def test_profile_url(self): eq_(u'/profiles/testuser/', profile_url(self.u))
def deactivate(request): user = get_object_or_404(User, id=request.POST['user_id'], is_active=True) user.is_active = False user.save() return HttpResponseRedirect(profile_url(user))
def url(self): return profile_url(self._request.user)
def test_profile_url(self): eq_(u'/profiles/testuser', profile_url(self.u))
def test_profile_url(self): eq_(u'/user/500000', profile_url(self.u))