Commit graph

23031 commits

Author SHA1 Message Date
Chinmay D. Pai
fb511b1dfd
fix(email): check if communication hasattr for attachment
fixes issue where previous communication has no attribute _attachments
before it fails, causing the following error:

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 99, in execute_job
    method(**kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 724, in pull_from_email_account
    email_account.receive()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 295, in receive
    attachments = [d.file_name for d in communication._attachments]
AttributeError: 'Communication' object has no attribute '_attachments'

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-01-05 00:35:06 +05:30
Suraj Shetty
0e5e3497b1
fix: as_table msgprint (#9174)
* chore: improve readability

* fix: as_table msgprint

- fix as_table msgprint style and functionality
- Make table creation code more readable
- Make a text translatable

* style: Fix few deepsource issues

* style: Fix few deepsource issues

fix indentation

* fix: Incorrect assignment

* fix: Scrub URLs only for html format

* fix(typo): msg -> message

Co-authored-by: Raffael Meyer <meyer.raffael@gmail.com>
2020-01-04 21:05:02 +05:30
Suraj Shetty
18d8e65cca
fix: Make background jobs logging quieter if quite flag is pass… (#9200) 2020-01-04 19:12:59 +05:30
mergify[bot]
7171a2bb27
Merge pull request #9189 from Thunderbottom/email-encode-fix
fix(email): safe_encode to avoid smtp ascii encoding issue
2020-01-04 08:30:19 +00:00
mergify[bot]
1549399c55
Merge pull request #9197 from hrwX/smtp-fx
fix(email): define _email_account before assignment
2020-01-04 04:21:53 +00:00
Himanshu Warekar
1b4ecdf792 fix: unreferenced variable 2020-01-04 09:26:23 +05:30
mergify[bot]
ceeea6180f
Merge pull request #9193 from surajshetty3416/disable-testing-by-default
chore: Disable testing for all sites by default
2020-01-03 18:17:59 +00:00
Chinmay D. Pai
250c44bed8
chore: pass email_body test
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-01-03 23:14:08 +05:30
Suraj Shetty
58825e89a8 feat: Disable testing for all sites by default
To avoid accidental test execution on production sites
2020-01-03 22:08:06 +05:30
Chinmay D. Pai
ce2a0854db
fix(email): safe_encode to avoid smtp ascii encoding issue
fixes issue where smtplib fails to encode the mail as ascii

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 60, in application
    response = frappe.api.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 22, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 61, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1042, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 801, in reset_password
    user.reset_password(send_email=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 234, in reset_password
    self.password_reset_mail(link)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 253, in password_reset_mail
    "password_reset", {"link": link}, now=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 298, in send_login_mail
    delayed=(not now) if now!=None else self.flags.delay_emails, retry=3)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 476, in sendmail
    inline_images=inline_images, header=header, print_letterhead=print_letterhead)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/queue.py", line 162, in send
    print_letterhead=print_letterhead)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/queue.py", line 185, in add
    send_one(email_queue.name, now=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/queue.py", line 475, in send_one
    raise e
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/queue.py", line 415, in send_one
    smtpserver.sess.sendmail(email.sender, recipient.recipient, message)
  File "/usr/lib64/python3.6/smtplib.py", line 855, in sendmail
    msg = _fix_eols(msg).encode('ascii')
UnicodeEncodeError: 'ascii' codec can't encode characters in position 335-339: ordinal not in range(128)

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-01-03 14:56:15 +05:30
Mohammed Safwat Abu Kwaik
4ac83a0cc8 fix: allow setting custom database schema in site_config (#9182)
* Update database.py

* Update frappe/database/postgres/database.py

Co-Authored-By: Chinmay Pai <chinmaydpai@gmail.com>

Co-authored-by: Chinmay Pai <chinmaydpai@gmail.com>
2020-01-02 22:20:04 +05:30
mergify[bot]
9a63bdf337
Merge pull request #9184 from gavindsouza/build-symlinks-fix
fix: bench build broken assets symlinks
2020-01-02 05:07:00 +00:00
Gavin D'souza
04bc216966 fix: python 2 compatibility for symlink creation 2020-01-02 10:10:55 +05:30
Gavin D'souza
658fcac454 fix: avoid race condition to create symlinks 2020-01-02 10:10:53 +05:30
Gavin D'souza
49fc64618a fix: bench build "Cannot link {assets} to {site assets}" 2020-01-02 10:05:47 +05:30
mergify[bot]
dab18b8f90
Merge pull request #9022 from Thunderbottom/chat-fix
fix(chat): refactor code to make chat work
2020-01-01 11:10:41 +00:00
mergify[bot]
9b7c5915c7
Merge pull request #9039 from Thunderbottom/email_ssl
feat(email): send over ssl and append outgoing mails to sent folder
2020-01-01 08:38:48 +00:00
mergify[bot]
1e60a86276
Merge pull request #9172 from Alchez/dev-webhook-tables
fix: allow tables to be sent with dates in webhook (develop)
2020-01-01 07:09:31 +00:00
Suraj Shetty
28d5d39acf
Merge branch 'develop' into dev-webhook-tables 2020-01-01 12:02:53 +05:30
Chinmay D. Pai
4c138390b6
fix: move email status check to fix travis
mail status wasn't being set when the check was run, so the output for
any() would always be false, and none of the mails would have status set
to sent in the backend. moving the check to a point after setting status
for each email should fix this issue

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-01-01 11:21:53 +05:30
mergify[bot]
da331254c0
Merge pull request #9164 from gavindsouza/rename-doc-merge-alert
feat: show_alert flag in rename_doc API
2020-01-01 05:40:08 +00:00
mergify[bot]
446cfbb6c3
Merge pull request #9180 from surajshetty3416/fix-energy-point-summary
fix: Use _ for translation since frappe._ is not supported
2020-01-01 05:17:32 +00:00
Suraj Shetty
f343d15995 fix: Remove _ & _dict from frappe because add_module_properties ignores it 2020-01-01 09:34:37 +05:30
Suraj Shetty
d5b08ca36f fix: Use _ for translation since frappe._ is not supported 2020-01-01 09:29:12 +05:30
Faris Ansari
a2075477fc fix: Bug in show/hide global cards (#9163)
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
2020-01-01 09:11:40 +05:30
mergify[bot]
c74aa7bcfe
Merge pull request #9157 from sagarvora/fix-jinja-dev
fix: (re)allow custom filters/methods to be used with jinja
2019-12-31 16:14:13 +00:00
Suraj Shetty
e2935b5ba6 refactor: Commonify sent mail checks
-and fix formatting
2019-12-31 21:09:40 +05:30
mergify[bot]
f393d0d72b
Merge pull request #9145 from hrwX/qe_cf
feat(Customize Form): Ability to add fields to quick entry
2019-12-31 15:22:19 +00:00
Suraj Shetty
295c5f89f1
Merge branch 'develop' into email_ssl 2019-12-31 20:47:11 +05:30
Suraj Shetty
25c66b384b
Merge branch 'develop' into rename-doc-merge-alert 2019-12-31 20:37:04 +05:30
mergify[bot]
106c3eb6b9
Merge pull request #9144 from scmmishra/awesome-bar
feat: wider awesomebar
2019-12-31 15:04:58 +00:00
Suraj Shetty
03ca005f68
Merge branch 'develop' into qe_cf 2019-12-31 20:26:58 +05:30
Suraj Shetty
67fa01242c
Merge branch 'develop' into dev-webhook-tables 2019-12-31 20:18:22 +05:30
mergify[bot]
ed89e828ef
Merge pull request #9154 from Thunderbottom/bytes-fix
fix(email): handle case where cstr returns text_type of str
2019-12-31 14:35:17 +00:00
Suraj Shetty
32c1ddf97f
Merge branch 'develop' into awesome-bar 2019-12-31 19:36:55 +05:30
Suraj Shetty
ba02670532
Merge branch 'develop' into bytes-fix 2019-12-31 19:36:43 +05:30
Suraj Shetty
2d1e814d3e
Merge branch 'develop' into dev-webhook-tables 2019-12-31 19:36:29 +05:30
mergify[bot]
8144b42e29
Merge pull request #9175 from Thunderbottom/psycopg2-fix
fix(requirements): remove psycopg2 from requirements
2019-12-31 13:53:21 +00:00
mergify[bot]
79728658f4
Merge pull request #9173 from prssanna/depends-on-test
test: fix depends on ui test
2019-12-31 13:52:24 +00:00
Suraj Shetty
e9b801fca8
Merge branch 'develop' into depends-on-test 2019-12-31 19:03:53 +05:30
Suraj Shetty
f6e04d80f2
Merge branch 'develop' into psycopg2-fix 2019-12-31 19:03:31 +05:30
Rucha Mahabal
0778c337ae fix(Auto Repeat): derive next date from start date and offset (#9177) 2019-12-31 18:51:09 +05:30
Chinmay D. Pai
459e550a3f
fix(requirements): remove psycopg2 from requirements
apparently, since version 2.8, psycopg2 does not install the binary
version by default (read source), and hence fails on setup with the
error:

Error: pg_config executable not found

since nobody can really be arsed to compile this binary on their own,
we'll stick to using psycopg2-binary instead.

source: https://www.postgresql.org/message-id/CA%2Bmi_8bd6kJHLTGkuyHSnqcgDrJ1uHgQWvXCKQFD3tPQBUa2Bw%40mail.gmail.com

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2019-12-31 18:19:15 +05:30
prssanna
78ee7c79f6 fix: fix depends on ui test 2019-12-31 16:01:59 +05:30
Suraj Shetty
50e014f853
Merge branch 'develop' into bytes-fix 2019-12-31 15:38:02 +05:30
Suraj Shetty
d779c4fc32
Merge branch 'develop' into awesome-bar 2019-12-31 15:36:46 +05:30
Rohan Bansal
547a4d3ca0 fix: allow tables to be sent in webhook 2019-12-31 13:28:44 +05:30
Rohan
9ab56d65ab fix: serialize datetime objects in child table documents 2019-12-31 13:28:41 +05:30
Rohan
7f7760db33 fix: serialize child table document objects 2019-12-31 13:28:39 +05:30
rohitwaghchaure
3ba9c2dfd4
Merge pull request #8775 from rohitwaghchaure/email_not_pull_because_of_contact_error
fix: Name of Contact cannot be Contact error while creating communication for incoming emails
2019-12-31 10:27:17 +05:30