Skip to content
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

Update lead.py #8789

Merged
merged 3 commits into from May 19, 2017
Merged

Update lead.py #8789

merged 3 commits into from May 19, 2017

Conversation

hereabdulla
Copy link
Contributor

Import datetime to compare next contact date with now()

Import datetime to compare next contact date with now()
@rmehta
Copy link
Member

rmehta commented May 13, 2017

What is the use case?

@hereabdulla
Copy link
Contributor Author

@@ -45,7 +46,7 @@ def validate(self):

self.image = has_gravatar(self.email_id)

if self.contact_date and self.contact_date < now():
if self.contact_date and self.contact_date < datetime.now():
Copy link
Member

@nabinhait nabinhait May 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

datetime.now() can create problem with user date format.

Instead use nowdate() function from frappe.utils

getdate(self.contact_date) < getdate(nowdate())

As per the suggestion from Nabin,instead of Datetime,getdate and nowdate from frappe.utils imported
@rmehta rmehta merged commit 6cbc9b0 into frappe:develop May 19, 2017
@hereabdulla hereabdulla deleted the patch-1 branch May 19, 2017 09:46
nabinhait pushed a commit that referenced this pull request May 24, 2017
* Update lead.py

Import datetime to compare next contact date with now()

* Update lead.py

* Update lead.py

As per the suggestion from Nabin,instead of Datetime,getdate and nowdate from frappe.utils imported
nabinhait added a commit that referenced this pull request May 24, 2017
nabinhait added a commit that referenced this pull request May 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants