Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web admin: bulk import generate useless admin API audit log entry in DB #5037

Closed
nqb opened this issue Jan 9, 2020 · 1 comment
Closed

Comments

@nqb
Copy link
Contributor

nqb commented Jan 9, 2020

Each time you make a CSV import, two rows are inserted in admin_api_audit_log table:

  • one with JSON payload
  • one with an empty JSON payload (useless)

Example:

*************************** 62. row ***************************
        id: 62
 tenant_id: 1
created_at: 2020-01-09 09:17:09.413567
 user_name: admin
    action: api.v1.Users.bulk_import
 object_id: NULL
       url: /api/v1/users/bulk_import
    method: POST
   request: {"ignoreInsertIfNotExists":false,"ignoreUpdateIfExists":false,"items":[{"firstname":"firstname","lastname":"lastname","password":"************************","pid":"pid"},{"firstname":"Nicolas","lastname":"Quiniou","password":"************************","pid":"nqb"},{"firstname":"Test","lastname":"Quiniou","password":"************************","pid":"test"},{"firstname":"Test","lastname":"Quiniou","password":"************************","pid":"test3"}],"stopOnFirstError":true}
    status: 200
*************************** 63. row ***************************
        id: 63
 tenant_id: 1
created_at: 2020-01-09 09:17:09.473079
 user_name: admin
    action: api.v1.Users.bulk_import
 object_id: NULL
       url: /api/v1/users/bulk_import
    method: POST
   request: {"items":[]}
    status: 200

To Reproduce
Steps to reproduce the behavior:

  1. Make a CSV import
  2. Go in Admin API Audit logs menu

Expected behavior
Only one Admin API audit log entry by bulk import.

@nqb
Copy link
Contributor Author

nqb commented Jan 9, 2020

In fact, I just noticed that web admin send two API calls. Admin API audit log is correct, frontend needs to be adjusted. Reassigning.

@nqb nqb assigned satkunas and unassigned jrouzierinverse Jan 9, 2020
@nqb nqb changed the title API: bulk import generate useless admin API audit log entry in DB web admin: bulk import generate useless admin API audit log entry in DB Jan 9, 2020
@nqb nqb removed the API label Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants