ObjectStore uploader requires presence of associated `uploads` record
when deleting the upload file (through the carrierwave's after_commit
hook) because we keep info whether file is LOCAL or REMOTE in `upload`
object.
For this reason we can not destroy uploads as "dependent: :destroy" hook
because these would be deleted too soon. Instead we rely on
carrierwave's hook to destroy `uploads` in after_commit hook.
But in before_destroy hook we still have to delete not-mounted uploads
(which don't use carrierwave's destroy hook). This has to be done in
before_Destroy instead of after_commit because `FileUpload` requires
existence of model's object on destroy action.
This is not ideal state of things, in a next step we should investigate
how to unify model dependencies so we can use same workflow for all
uploads.
Related to #45425
When terms are enforced, but the user has not accepted the terms
access to the API & git is rejected with a message directing the user
to the web app to accept the terms.
With Geo, attempting to view an endpoint with a user could result in an
Error 500 since Devise attempts to update the last sign-in IP and other
details.
Closesgitlab-org/gitlab-ee#4972
As per the discussion with @psimyn, this change does not affect the frontend, so user input will not be validated on the signin screen.
Instead, the value sent to the backend has leading and trailing whitespace stripped before looking up the user with find_by.
Closes#42637
This change is required because otherwise if a user is created with a
value for `projects_limit` that matches the DB default, it gets
overwritten by `current_application_settings.default_projects_limit`. By
removing the default we once again can allow a user to be created with a
limit of 10 projects without the risk that it'll change to 10000
(10.2) Avoid partial partial email adresses for matching
See merge request gitlab/gitlabhq!2232
(cherry picked from commit 081aa1e91a777c9acb31be4a1e76b3dd7032fa9a)
There are unresolved conflicts in app/models/user.rb.
fa85a3fd Don't allow searching for partial user emails
By caching the number of personal SSH keys we reduce the number of
queries necessary on pages such as ProjectsController#show (which can
end up querying this data multiple times).
The cache is refreshed/flushed whenever an SSH key is added, removed, or
when a user is removed.
By using SQL::Union we can return a proper ActiveRecord::Relation,
making it possible to select the columns we're interested in (instead of
all of them).
Replaces all the explicit include metadata syntax in the specs (tag:
true) into the implicit one (:tag).
Added a cop to prevent future errors and handle autocorrection.