mirror of
https://github.com/sismics/docs.git
synced 2025-12-13 09:46:17 +00:00
Quota updates are not polluting the audit log anymore
This commit is contained in:
@@ -110,6 +110,26 @@ public class UserDao {
|
||||
return user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a user's quota.
|
||||
*
|
||||
* @param user User to update
|
||||
* @return Updated user
|
||||
*/
|
||||
public User updateQuota(User user) {
|
||||
EntityManager em = ThreadLocalContext.get().getEntityManager();
|
||||
|
||||
// Get the user
|
||||
Query q = em.createQuery("select u from User u where u.id = :id and u.deleteDate is null");
|
||||
q.setParameter("id", user.getId());
|
||||
User userFromDb = (User) q.getSingleResult();
|
||||
|
||||
// Update the user
|
||||
userFromDb.setStorageQuota(user.getStorageQuota());
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the user password.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user