-
Notifications
You must be signed in to change notification settings - Fork 1
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
✨(contacts) add notes
& force full_name
#565
Conversation
69ac7a3
to
32941fd
Compare
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.
Cool le renommage :)
src/backend/core/factories.py
Outdated
@@ -115,7 +115,17 @@ class ContactFactory(BaseContactFactory): | |||
class Meta: | |||
model = models.Contact | |||
|
|||
base = factory.SubFactory("core.factories.ContactFactory", base=None, owner=None) | |||
# base = factory.SubFactory("core.factories.ContactFactory", base=None, owner=None) |
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.
tu as oublié de la supprimer ;)
@@ -20,49 +20,49 @@ def test_models_contacts_str_full_name(): | |||
def test_models_contacts_base_self(): | |||
"""A contact should not point to itself as a base contact.""" |
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.
Dans ces deux lignes tu ne veux pas renommer le base en override ?
"{'__all__': ['A contact cannot point to a base contact that itself points to a " | ||
"base contact.', 'A contact cannot be based on itself.']}" | ||
"{'__all__': ['A contact cannot point to a base contact that itself overrides " | ||
"a contact.', 'A contact cannot override itself.']}" | ||
) | ||
assert str(excinfo.value) == error_message | ||
|
||
|
||
def test_models_contacts_base_to_base(): | ||
"""A contact should not point to a base contact that is itself derived from a base contact.""" |
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.
Pareil ici
"{'__all__': ['A contact cannot point to a base contact that itself points to a " | ||
"base contact.']}" | ||
"{'__all__': ['A contact cannot point to a base contact that itself overrides " | ||
"a contact.']}" | ||
) | ||
assert str(excinfo.value) == error_message | ||
|
||
|
||
def test_models_contacts_owner_base_unique(): | ||
"""There should be only one contact deriving from a given base contact for a given owner.""" |
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.
Pareil ;)
32941fd
to
17ead08
Compare
We make the full name mandatory and add a field to allow user to store personnal notes on the contact. This also make the "base" contact not mandatory because user may want to create new contacts out of the blue.
To improve code readability, I propose to rename the contact field `override`. This comes along with the fact a contact should not not always override another (it's the case were I only want to create some personal contacts).
17ead08
to
127bd7b
Compare
Purpose
We make the full name mandatory and add a field to allow user to store personal notes on the contact.
This also make the "base" contact not mandatory because user may want to create new contacts out of the blue.
Note: this PR also renames the
base
field tooverride
to be more explicit.FIXES #506
Proposal
notes
fieldfull_name
mandatorybase
field tooverride