ckan / ckan

CKAN is an open-source DMS (data management system) for powering data hubs and data portals. CKAN makes it easy to publish, share and use data. It powers catalog.data.gov, open.canada.ca/data, data.humdata.org among many other sites.

Home Page:https://ckan.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sysadmin editing user profile page uses wrong value for email notifications checkbox

ThrawnCA opened this issue · comments

CKAN version

2.10

Describe the bug

When the activity plugin is enabled, the email notifications checkbox on editing a user profile draws its value from the current user (g.userobj), not the user being edited. When a sysadmin edits someone else's user profile, the checkbox value will be based on the sysadmin's profile, not the user's - and it will then overwrite the user's profile with that value.

Steps to reproduce

  • Create a CKAN instance with the 'activity' plugin enabled.
  • Create two accounts: one regular account with email notifications enabled, one with sysadmin privileges and email notifications disabled.
  • Log in as the unprivileged user and edit your profile. The email notification checkbox will be checked, as expected.
  • Log in as the sysadmin and edit the unprivileged user's profile. The email notification checkbox will be unchecked (this is an error - it should remain checked).
  • Save the form.
  • Log in as the unprivileged user.
  • Edit your profile. The email notification checkbox will be unchecked (this is an error; the sysadmin did not touch it when editing the form, so it should not have changed).

Expected behavior

The email notification checkbox should preserve the value that the user has specified.