Граф коммитов

490 Коммитов

Автор SHA1 Сообщение Дата
Mathieu Pillard da0d02c7d9
Don't fail when displaying IPv6 and IPv4 together in the admin (#22820) 2024-11-06 17:47:00 +01:00
Andrew Williamson 8b100c94ae
Hold actions on the back of decisions, rather than process them, if content is high profile (#22766)
* 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
2024-10-18 11:24:26 +01:00
Mathieu Pillard c31188ca7d
Force collation when comparing Denied Names to avoid unwanted collisions (#22767)
* Force collation when comparing Denied Names to avoid unwanted collisions
2024-10-16 13:03:43 +02:00
Andrew Williamson dd200ad058
stop ignoring ruff rule B904 (#22641) 2024-09-05 12:07:00 +01:00
Mathieu Pillard c63512df23
Remove caching of DeniedNames - replace with a single database query (#22626) 2024-09-03 14:30:25 +02:00
Mathieu Pillard 63eedd31cf
Avoid extra queries around banned user content in user admin (#22500)
* 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.
2024-07-23 14:45:09 +02:00
Mathieu Pillard 0bc41c8a25
Fix intermittent test failure in TestUserAdmin::test_search_* (#22376)
Search for the whole user string instead of the pk which could
appear by accident.
2024-06-18 17:10:52 +02:00
Kevin Meinhardt 8fc73b3a30
Split tests for faster execution (#22318)
* Split tests for faster execution

* TMP: remove uneeded step

* TMP: revert remove assertNumQueries

* TMP: sort directories for logs

* TMP: Missing }

* TMP: unify default splits
2024-06-13 16:59:58 +02:00
Kevin Meinhardt 26be57fcaf
Improve usability of verify email page when verification is pending or timedout (#22084)
* Remove code snippet filter for email history in verify email flow

* Improve UI usability for verify email flow with pending/timedout state

* Extend suppressed email verification timeout to 1 minute

* Update src/olympia/devhub/templates/devhub/verify_email.html

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>

* Update src/olympia/devhub/templates/devhub/verify_email.html

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>

* Update src/olympia/devhub/templates/devhub/verify_email.html

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>

* Update src/olympia/devhub/templates/devhub/verify_email.html

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>

* Add css truncation to email history table cells

* Increase email verification timeout to 10 minutes and refresh rate to 30 seconds

* Add amo_devhub suffix to SUPPORT_EMAIL

* Fix support link test

* Improve confirmation delivered screen on email suppression flow:

- hide table if email is confirmed delivered
- add a "success" header to indicate it all went well

---------

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>
2024-04-02 10:05:38 +02:00
Kevin Meinhardt 059193a3d3
Simplify socketlabs check for status and messaging when something goes wrong. (#22005)
* 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>
2024-03-19 17:30:54 +01:00
dependabot[bot] 8a99ae753e
Bump ruff from 0.2.2 to 0.3.2 in /requirements (#21994)
* Bump ruff from 0.2.2 to 0.3.2 in /requirements

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.2.2 to 0.3.2.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.2.2...v0.3.2)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* ruff formatting changes in 0.3.0

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Williamson <awilliamson@mozilla.com>
2024-03-18 11:28:28 +00:00
Kevin Meinhardt 45421840da
Sync suppressed emails daily (#21998)
* Raname suppression sync task

* Add cron job to sync suppressed emails daily
2024-03-12 18:18:26 +01:00
Kevin Meinhardt d655f89f4d
Improve logging for suppressed email confirmation task + fix relative URL in verification email (#21843)
* Improve logging for suppressed email confirmation task

* Add site url to verify email template

* Use absolutify to generate confirmation code
2024-02-20 18:08:57 +01:00
Kevin Meinhardt 6db88f387e
add management command for sync suppressed emails (#21784) 2024-02-01 13:39:36 +01:00
Andrew Williamson 5d35e7d543
Sign user deleted email as Mozilla Add-ons Team (#21768) 2024-01-31 10:14:47 +00:00
Greg Sherman 3d9dc28ae9
Remove FxA to MzA name change notification while deleting account (#21694) 2024-01-15 12:41:36 +01:00
Kevin Meinhardt 4ca4686edd
Implement email verification flow (#21603)
* 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
2024-01-08 13:13:41 +01:00
Kevin Meinhardt 59760f490e
tasks for verifying a suppressed email (#21635)
* chore(users): use url utils forming socketlab urls

* feat(user): add status field to SuppressedEmailVerification model

* feat(): implement suppressed email confirmation tasks
2024-01-03 14:17:58 +01:00
Kevin Meinhardt e6f7967539
feat(): add notification displaying suppressed emails (#21599) 2023-12-19 12:29:56 +01:00
Kevin Meinhardt 58e827015f
fet(users): Add SuppressedEmailVerification model (#21561) 2023-12-11 18:38:22 +01:00
Kevin Meinhardt 11233891cf
chore(users): fix multiple leaf migrations (#21580) 2023-12-08 11:27:53 +01:00
Mathieu Pillard b68869c7c2
Cinder metadata tweaks: make sure we send data that passes validation (#21573)
* 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
2023-12-07 17:43:05 +01:00
Kevin Meinhardt e57a63bd13
ADDSRV-601 Download suppression list and add EmailBlock instances. (#21556)
* 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>
2023-12-07 11:19:39 +01:00
Andrew Williamson 1c45d95a71
move ActivityLog.create to ActivityLogManager (#21484)
* move ActivityLog.create to ActivityLogManager

* fix broken test

* fix bad merge

* drop action as an arg for create method
2023-11-29 16:33:08 +00:00
Mathieu Pillard 8aed9a47fb
Copy user picture to cloud storage when reporting and banning, restore it on unban (#21496) 2023-11-27 11:11:11 +01:00
Mathieu Pillard 4005602c5d
Implement unbanning user(s) functionality in admin/cinder webhook action (#21472)
* Implement unbanning user(s) functionality in admin/cinder webhook action
2023-11-21 17:56:28 +01:00
Mathieu Pillard 58c267a88f
Store relationships we delete on ban to be able to restore them later on unban (#21454)
* Store relationships we delete on ban to be able to restore them later on unban
2023-11-21 12:42:29 +01:00
Mathieu Pillard f058921dd8
Stop anonymizing user data on ban (#21443)
* Stop anonymizing user data on ban
2023-11-14 17:47:51 +01:00
Andrew Williamson 33da485b0a
support webhook addon decisions (#21408)
* 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>
2023-11-08 15:23:51 +00:00
Andrew Williamson 9ffd8c12a7
switch from black to ruff format (#21384)
* switch from black to ruff format

* Update Makefile-docker
2023-11-02 14:35:10 +00:00
Andrew Williamson 57e9aae553
Firefox Accounts to Mozilla accounts (#21202)
* Firefox Accounts to Mozilla accounts

* reword activity log text instead; simplify

* dropped l10n for `USER_AUTO_DELETED` activity
2023-09-19 10:34:39 +01:00
Andrew Williamson f774e37b89
fix missing asserts in tests (#20741)
* fix missing asserts in tests

* fix broken throttling test
2023-05-24 14:33:14 +01:00
William Durand f8e4663516
Add missing migrations (#20742) 2023-05-24 12:25:07 +02:00
Andrew Williamson e4038c3805
Enable isort (#20718)
* Enable isort in ruff

* auto-format codebase with isort
2023-05-23 15:36:16 +01:00
Andrew Williamson 9de0139836
Add UserRestrictions for Rating submission and auto moderation (#20581)
* 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
2023-04-18 16:04:34 +02:00
Andrew Williamson 17ae239f23
add reviewer page listing add-ons for a developer (#20358)
* add reviewer page listing add-ons for a developer

* on review page comma seperate authors; add a test
2023-02-17 15:14:16 +00:00
Mathieu Pillard 27c172fb70
Add reason to user restrictions stored in database (#20327)
* 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
2023-02-10 11:22:35 +01:00
Mathieu Pillard 155e5ff329
Tweak ActivityLog to make activity admin pages more useful (#20246)
* 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
2023-01-30 21:51:14 +01:00
Mathieu Pillard 45d3ee8099
Remove translations from reviewer/admin tools (#20209) 2023-01-23 11:07:12 +01:00
Andrew Williamson cf405eb9f2
rm reviewer scoring (#20195) 2023-01-18 12:25:14 +01:00
Mathieu Pillard 59beb0efc2
Add IP search for addons & ratings admin (#20101)
* Add IP search for addons & ratings admin
2023-01-11 12:06:25 +01:00
Mathieu Pillard de9bad03f0
Refactor IP address search to make it available to other admin tools (#20141) 2023-01-05 15:37:30 +01:00
Mathieu Pillard c2dff50566
Introduce a base ModelAdmin class, use it everywhere (#20105)
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)
2023-01-03 12:19:46 +01:00
Mathieu Pillard bc8368e546
Remove `user_responsible` from `Rating`, use `core.get_user()` instead (#20104) 2022-12-16 17:40:07 +01:00
Andrew Williamson 682938effc
rm /pages/appversions/ (#20073)
* rm /pages/appversions/

* update test; rm unused imports; rm amo/feeds.py

* more test variable changes
2022-12-12 10:04:19 +00:00
Mathieu Pillard 79b7680343
Fix searching for a single id in user admin (#20078) 2022-12-08 14:11:06 +01:00
Mathieu Pillard 037d43111f
Allow LIKE searches for email in user admin, drop search by username (#20057)
* Allow LIKE searches for email in user admin, drop search by username

* Add test
2022-12-06 18:24:39 +01:00
Mathieu Pillard 681e68866f
Add a max length on TextFields (#20056)
* 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.
2022-12-05 17:26:40 +01:00
Mathieu Pillard 9d5eff4ad1
Distinguish between FxA logins and API token logins in ActivityLog (#20044)
* Distinguish between FxA logins and API token logins in ActivityLog
2022-12-05 11:58:30 +01:00
Mathieu Pillard d46e64d554
"Upgrade" datetime.strptime()/dateutil.parser.parse() where possible (#20006)
* "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
2022-11-23 20:21:44 +01:00