Skip to content

Commit

Permalink
Merge pull request #549 from Cadasta/bugfix/#543
Browse files Browse the repository at this point in the history
Fix #543: Always show logged-in user's full name or username in page …
  • Loading branch information
oliverroick authored Aug 12, 2016
2 parents fafd590 + 7ff217f commit 6a766f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,6 @@ def test_get_with_authorized_user(self):
context['organization'] = self.org
context['form'] = forms.EditOrganizationMemberForm(
None, self.org, self.member)
context['user'] = self.member

expected = render_to_string(
'organization/organization_members_edit.html',
Expand Down
5 changes: 5 additions & 0 deletions cadasta/organization/views/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ def get_success_url(self):
def get_queryset(self):
return self.get_organization().users.all()

def get_context_object_name(self, obj):
# Dummy context so that the currently viewed user does not
# override the logged-in user
return 'org_member'

def get_form(self):
if self.request.method == 'POST':
return self.form_class(self.request.POST,
Expand Down

0 comments on commit 6a766f5

Please sign in to comment.