-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[back] feat: add the EntityContext
model
#1844
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GresilleSiffle
added
Backend
Back-end code of Tournesol
Frontend
Front-end code of Tournesol
labels
Nov 16, 2023
... and displayed in the front end
... want to be able to add more than one URLs in the text.
GresilleSiffle
commented
Nov 23, 2023
except FAQEntry.answers.RelatedObjectDoesNotExist: # pylint: disable=no-member | ||
return False | ||
else: | ||
if obj.answers.exists(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously this method was always returning True.
GresilleSiffle
commented
Nov 23, 2023
@@ -126,26 +125,52 @@ def get_user_proof(self, user_id: int, keyword: str): | |||
signer = Signer(salt=f"{keyword}:{self.name}") | |||
return signer.sign(f"{user_id:05d}") | |||
|
|||
def entity_in_moderation(self, entity_metadata) -> bool: | |||
def entity_has_unsafe_context(self, entity_metadata) -> tuple: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not forget to delete the field moderation
in the next update.
GresilleSiffle
changed the title
WIP / [back] feat: add the
[back] feat: add the Nov 27, 2023
EntityContext
modelEntityContext
model
9 tasks
amatissart
reviewed
Nov 30, 2023
amatissart
approved these changes
Nov 30, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
related to #1852
Description
This PR replaces the
poll.moderation
system byEntitContext
. A model used to represent a textual localized context related to one or more entities.Those contexts can be enabled or disabled from the admin interface, and can target entities based on any of their metadata. All
EntitContext
related to an entity are returned by the views using theRecommendationSerializer
. When its attributeunsafe
is set to True, all related entities will be marked as unsafe.Scope of this PR:
EntitContext
instead ofpoll.moderation
EntitContext
(other views will be updated in following PRs)EntityContext
created by the association (other pages, like comparison will be updated in following PRs)Out of scope:
to-do
back end - model EntityContext
source_url
andsource_label
to simplify the modeldelete the concept oforigin
?back end
poll.entity_has_unsafe_context
poll.get_entity_contexts
entity_poll_rating.unsafe_recommendation_reasons
(update the existing tests)back end serializers
RecommendationSerializer
should include the entity contextsfront end
front end - analysis page
front end - recommendations
front end - comparison
Checklist