-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(besoins): méthode pour dupliquer un besoin #1097
Conversation
4470298
to
613f5c1
Compare
613f5c1
to
02351cc
Compare
lemarche/www/tenders/utils.py
Outdated
def duplicate(tender: Tender) -> Tender: | ||
FIELDS_TO_REMOVE = ( | ||
["_state", "_django_version"] | ||
+ ["id", "slug", "siae_transactioned", "extra_data", "import_raw_object"] | ||
+ Tender.READONLY_FIELDS | ||
) |
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.
def duplicate(tender: Tender) -> Tender: | |
FIELDS_TO_REMOVE = ( | |
["_state", "_django_version"] | |
+ ["id", "slug", "siae_transactioned", "extra_data", "import_raw_object"] | |
+ Tender.READONLY_FIELDS | |
) | |
FIELDS_TO_REMOVE = ( | |
["_state", "_django_version"] | |
+ ["id", "slug", "siae_transactioned", "extra_data", "import_raw_object"] | |
+ Tender.READONLY_FIELDS | |
) | |
def duplicate(tender: Tender, fields_to_remove=FIELDS_TO_REMOVE) -> Tender: |
Je le mettrais en argument au cas où ^^
L'autre option serait de laisser comme t'as fait initialement et t'ajoute un argument à duplicate
du type extra_fields_to_remove
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.
okay t'as raison je vais rendre ca un peu plus réutilisable
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.
fixé ici 9661477
Quoi ?
Nouveau utils
duplicate(tender)
Ajout de test
Pourquoi ?
Parfois demandé par un admin. En attendant de rajouter un bouton