aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/serializers.py (follow)
Commit message (Collapse)AuthorAgeLines
* Add alternate accounts to the user modelGravatar jchristgit2024-05-23-2/+54
| | | | | Introduce a way to store alternate accounts on the user, and add the `PATCH /bot/users/<id:str>/alts` endpoint, which allows updating the user's alt accounts to the alt accounts in the request..
* Prefetch the filter_list field in the FilterListSerializerGravatar Joe Banks2024-04-01-1/+1
|
* Add display_name to serializerGravatar Joe Banks2024-04-01-1/+1
|
* Merge branch 'main' into mailing-list-modelGravatar Xithrius2024-02-03-13/+5
|\
| * Prefetch user and actor in expanded infraction viewGravatar Johannes Christ2023-12-15-7/+2
| | | | | | | | | | Prevent N+1 reported by Sentry: https://python-discord.sentry.io/issues/4721126467/?project=2714379&query=is%3Aunresolved&referrer=issue-stream&statsPeriod=90d&stream_index=3
| * insert deleted messages as a BatchGravatar shtlrs2023-12-15-6/+3
| | | | | | | | Sentry is sending an N+1 query alert because of the way we were inserting messages (one by one)
* | Migrate mailing lists to their own API endpointsGravatar Johannes Christ2023-12-17-0/+36
|/ | | | | | Add a new model for the bot to store its mailing list state in, as opposed to the current JSON blob in the BotSetting table. Migrate the existing settings from the BotSetting table into the new model.
* Unify frozen fields logic into serializer mixin (#1169)Gravatar jchristgit2023-12-11-3/+31
| | | | Additionally, implement frozen fields on the offensive message serializer.
* Add maximum auto-timeout duration validationGravatar Boris Muratov2023-04-05-6/+25
|
* Rename additional_field to additional_settingsGravatar mbaruh2023-03-26-4/+5
|
* Use consistent quoting styleGravatar mbaruh2023-03-25-34/+34
| | | | Co-authored-by: Johannes Christ <[email protected]>
* Specify the common elements in the validation errorsGravatar mbaruh2023-03-25-12/+22
| | | | Co-authored-by: Amrou <[email protected]>
* Merge the extra kwargs creation functionsGravatar mbaruh2023-03-25-18/+5
| | | | Co-authored-by: Amrou <[email protected]>
* Merge branch 'main' into new-filter-schemaGravatar mbaruh2023-03-21-1/+2
|\
| * Add jump_url field to infraction modelGravatar vivekashok12212023-02-17-1/+2
| |
* | Fix filter serializers for false-y valuesGravatar mbaruh2023-02-11-1/+1
| | | | | | | | Co-authored-by: GDWR <[email protected]>
* | Update viewsets, fix lintingGravatar mbaruh2023-01-28-12/+38
| |
* | Make filter unique constraint use NULLS NOT DISTINCTGravatar mbaruh2023-01-28-0/+9
| | | | | | | | | | | | The existing constraint was ineffective as null values were considered distinct, and so two filters with the same content and no overrides were considered different. This change uses a new PSQL 15 feature unsupported in django currently, and so it is added with raw SQL.
* | Merge branch 'main' into new-filter-schemaGravatar mbaruh2023-01-27-1/+9
|\|
| * add thread_id to serializer's fieldsGravatar Amrou Bellalouna2022-11-06-1/+9
| |
* | Fix filter serializers validation to account for filterlist settingsGravatar mbaruh2023-01-27-20/+20
| |
* | Rename delete_messages to the more generic remove_contextGravatar mbaruh2022-11-09-2/+2
| |
* | Add creation and update timestamps to filtering modelsGravatar mbaruh2022-11-05-4/+4
| | | | | | | | This is to support auto-infractions reporting (bot 7fcec400)
* | Stop using None as a valid setting valueGravatar mbaruh2022-11-04-16/+7
| | | | | | | | See e100ae9b on bot
* | Refactors filters serialierGravatar mbaruh2022-10-18-81/+89
| |
* | Allow char fields to be blankGravatar mbaruh2022-10-10-1/+11
| | | | | | | | | | | | This is necessary allow filters to define a blank message when the default is not blank. Additionally allows bypass_roles to be empty like the other array fields
* | Allow ping arrays to be emptyGravatar mbaruh2022-10-08-0/+4
| |
* | Fix categories validationGravatar mbaruh2022-10-08-1/+4
| |
* | Add infraction channel settingGravatar mbaruh2022-10-08-1/+5
| |
* | Properly add dm_embed to serializersGravatar mbaruh2022-10-07-0/+1
| |
* | Merge branch 'main' into new-filter-schemaGravatar mbaruh2022-10-07-0/+1
|\|
| * Added `last_applied` to `serializers`Gravatar ionite342022-08-03-0/+1
| |
* | Bring back enabled categoriesGravatar mbaruh2022-10-01-2/+4
| | | | | | | | There needs to be a way to only enable a filter in a specific category, so this setting now fulfills that role. Disabled channels can be used to disable a filter in a specific channel within the category.
* | Fix send_alert not being added correctly in serializersGravatar mbaruh2022-09-30-0/+1
| |
* | Merge branch 'main' into new-filter-schemaGravatar mbaruh2022-07-15-9/+51
|\|
| * fixup: don't use "We" in docstringGravatar ChrisJL2022-03-18-2/+1
| | | | | | Co-authored-by: Mark <[email protected]>
| * Only return list of ints when retrieving all BumpedThreadsGravatar Chris Lovering2022-03-16-0/+17
| |
| * Add support for BumpedThreads to be stored in siteGravatar Chris Lovering2022-03-16-0/+11
| | | | | | | | | | | | Following our move to use Redis as just a cache, this PR allows the site to store a list of threads that need to be bumped. The bot will interact with this within the ThreadBumper cog.
| * Add reason field to AoC completionist block tableGravatar D0rs4n2022-03-09-1/+1
| |
| * Add support for storing AoC related data in siteGravatar D0rs4n2022-03-07-0/+22
| |
| * Prevent race condition with duplicate infractionsGravatar Johannes Christ2022-02-21-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DRF's `UniqueTogetherValidator` validates uniqueness by querying the database before running the actual insert. This is not, has not, and will never be valid, unless you happen to run a single worker, on a single thread, and your single worker running on a single thread is the only client for the database, in which case it may be valid. For any other cases, it's invalid, and it has never been valid. PostgreSQL spits out an `IntegrityError` for us if we have a duplicate entry, and PostgreSQL is the only valid and correct thing to trust here. The `UniqueTogetherValidator` is removed, and an existing test case calling into this validator to check for uniqueness is removed. Furthermore, to work around a Django quirk, `transaction.atomic()` is added to prevent one `subTest` from messing with another. Closes #665.
| * Merge branch 'main' into voicemuteGravatar ChrisJL2022-01-21-14/+36
| |\
| * | Implement voice mute + migration from voice mute -> voice banGravatar ks1292021-10-09-1/+1
| | |
* | | Change ping fields namesGravatar mbaruh2022-03-09-3/+3
| | |
* | | Patch a minor issue with FilterList field naming in migrationsGravatar D0rs4n2022-02-15-1/+2
| | |
* | | Merge branch 'main' into new-filter-schemaGravatar mbaruh2022-01-01-12/+17
|\ \ \ | | |/ | |/|
| * | Merge branch 'main' into otn_softdelGravatar Rohan Reddy Alleti2021-12-13-2/+19
| |\ \
| * | | Eliminate usage of typing module and update docstrings.Gravatar RohanJnr2021-11-05-6/+4
| | | |
| * | | Update docstring.Gravatar RohanJnr2021-07-22-1/+1
| | | |
| * | | Lint file and remove update() method declaration from ↵Gravatar RohanJnr2021-06-10-2/+3
| | | | | | | | | | | | | | | | OffTopicChannelNameListSerializer.