* seperate decision from action enforcement
* implement hold actions for BAN_USER
* implement hold actions for DELETE_RATING
* implement hold action for DELETE_COLLECTION
* migration number clash
* implement old actions for DISABLE_ADDON
* Avoid extra queries around banned user content in user admin
Before this change these queries would happen all the time: we display counts
of disabled content on ban for each type, that's 4 queries, and for every user,
even not banned, Django would execute them once to display the hidden instance
used to create additional instances when the user adds one, and another time
for the existing default instance displayed because of the `extra` bit.
Because those queries do JOINs _and_ there isn't even an actual
banned_user_content row to find, there were extra slow on top of being useless.
Preventing adds (it's an internal model anyway that admins should look at, but
not manually add) and removing the extra default instance fixes the problem.
* Simplify socketlabs check for status and messaging when something goes wrong.
* Fix comments
* Add more details and formatting to suppressed email status table.
* Copy fixes and updates
* Update src/olympia/devhub/templates/devhub/verify_email.html
Co-authored-by: Francesco Lodolo <flodolo@mozilla.com>
---------
Co-authored-by: Mozilla Add-ons Robot <addons-dev-automation+github@mozilla.com>
Co-authored-by: Francesco Lodolo <flodolo@mozilla.com>
* feat(): add email_verification property to UserProfile
* feat(users): add useful properties to SuppressedEmailVerification model
* feat(devhub): add email verification flow view logic
* chore(): use date only values for socketlabs recipient search
* chore(users): use url utils forming socketlab urls
* feat(user): add status field to SuppressedEmailVerification model
* feat(): implement suppressed email confirmation tasks
* Cinder metadata tweaks: make sure we send data that passes validation
* Refactor URL validation to use it across all APIs & migrate bad users.homepage data as well
* feat(users): add email_block model + migration
tmp: squash
* feat(): add task to sync blocked emails from socketlabs
Update src/olympia/lib/settings_base.py
Co-authored-by: Andrew Williamson <awilliamson@mozilla.com>
Update src/olympia/users/tasks.py
Co-authored-by: Andrew Williamson <awilliamson@mozilla.com>
Update src/olympia/users/tasks.py
Co-authored-by: Andrew Williamson <awilliamson@mozilla.com>
* tmp: use tempfile to process csv instead of storage
* tmp: rename emailblock to suppressedemail
---------
Co-authored-by: Andrew Williamson <awilliamson@mozilla.com>
* Record different reasons for a DISABLED override of an original status
* restore file statuses on force_enable
* add to test_ban_and_disable_related_content_bulk
* Apply suggestions from code review
Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>
* restore bulk File disabling
* move activity log inside conditions in is_user_disabled setter
---------
Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>
* Add UserRestrictions for Rating submission and auto moderation
* move RestrictionCheck from addons.utils to users.utils
* rename SUBMISSION and APPROVAL to mention add-on
* have seperate auto flag for restriction hits
* move import to the top
* Add reason to user restrictions stored in database
Automatically fill the reason when a scanner action adds a restriction.
* Add simple hack to make the text inputs larger on the restriction admins
* Make ActivityLog admin pages more useful
* Make IPLog unique per activity, show it in activity log admin
* Fix log strings for admin actions: {user} can be the admin user making the change
Set show_full_result_count = False on it to avoid a useless COUNT(*)
query (Used by django to show the full total of objets in the db
with no filters/search applied, which we don't need most of the time)
* Add a max length on TextFields
A database constraint will be added in a future issue, but we can stil make our forms & serializers fields enforce according to what is set on the models.
* "Upgrade" datetime.strptime()/dateutil.parser.parse() where possible
- strptime() is faster than dateutile.parser.parse() to parse a fixed format
- fromisoformat() is faster than strptime() to parse an iso 8601 date
* Fix class name