Commit graph

453 commits

Author SHA1 Message Date
Akhil Narang
3f1e19de85
refactor(treewide): enable RUF rules
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-21 16:20:28 +05:30
scdanieli
a1cb19c820 fix: ensure has_value_changed works for datetime, date and timedelta fields 2024-02-18 16:05:31 +01:00
Ankush Menat
4c925e0325 refactor: Reset password flow
- Hash one time reset tokens instead of storing them as is
- Up the perm level
- Use better source of randomness for generating token
- minor code cleanup here and there
2024-02-11 14:25:26 +05:30
Raffael Meyer
b3b02c809f
Merge pull request #24684 from barredterra/label-in-link-to-form 2024-02-09 21:03:07 +01:00
Akhil Narang
26ae0f3460
fix: ruff fixes
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-07 17:04:31 +05:30
barredterra
c282103867 fix: make get_url_to_form accept single doctype 2024-02-06 12:49:31 +01:00
Ankush Menat
de9ac89748 style: re-format with ruff 2024-02-05 18:53:33 +05:30
David Arnold
c09f48f5d7
feat: comply trackers with utm and add utm_content for a/b testing (#24521)
* feat: comply trackers with utm and add utm_content for a/b testing

* fix: make all other than source optional

this is plausible.io best practice

* fix: medium is not specified to be lowercase

* fix: ensure proper parameter quoting
2024-02-02 11:33:22 +05:30
barredterra
9e851aa0cc fix: allow name to be missing
for single doctypes
2024-02-01 18:16:05 +01:00
barredterra
5b6f05442e fix: translate label in link to form
When a single doctype is passed to `get_link_to_form`, use the translated doctype as the label.
2024-02-01 18:15:46 +01:00
Corentin Flr
dde34f9402
fix(money_in_words)!: Don't translate the result of num2words
It's unlikely that a translation for the results of num2words exists, because it should return a string that is already translated in the target language. If there are some numbers that have a specific translation, then it should already be handled in the num2words library. A domain-specific library is surely better at this hypothetical task than Frappe's generic translation system.

In French, 100 is called Cent. But in English, Cent is 1/100th of a dollar, which is called Centime in French.
Expected: num2words(200).title() == "Cent"
Actual: _(num2words(200).title()) == _("Cent") == "Centime"
2024-01-26 15:49:18 +01:00
barredterra
61a72b1803 fix: improve translatability of money in words 2024-01-23 19:24:12 +01:00
Ankush Menat
b71d01e1b4 fix: View logging fails if no referrer
```
AttributeError: 'NoneType' object has no attribute 'startswith'
  File "frappe/app.py", line 110, in application
    response = frappe.api.handle(request)
  File "frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
  File "frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
  File "frappe/handler.py", line 49, in handle
    data = execute_cmd(cmd)
  File "frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "__init__.py", line 1680, in call
    return fn(*args, **newargs)
  File "frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
  File "frappe/website/doctype/web_page_view/web_page_view.py", line 58, in make_view_log
    if not frappe.utils.is_site_link(path):
  File "frappe/utils/data.py", line 2488, in is_site_link
    if link.startswith("/"):
```
2024-01-01 19:15:25 +05:30
Hussain Nagaria
369844a9cb fix: type hint 2023-12-20 14:09:01 +05:30
Hussain Nagaria
ecdd7b3e37 docs: consistency 2023-12-20 14:02:32 +05:30
Hussain Nagaria
0df45daacd docs: get_number_format_info 2023-12-19 12:17:00 +05:30
Hussain Nagaria
370d575f29 docs: some more utils 2023-12-18 22:27:58 +05:30
Hussain Nagaria
3d35ee3e9e docs: get_link_to_form 2023-12-18 22:08:35 +05:30
Hussain Nagaria
a22451c6e2 docs: pdf_to_base64 2023-12-18 22:03:37 +05:30
Hussain Nagaria
cc9a866142 docs: get_thumbnail_base64_for_image 2023-12-18 22:00:44 +05:30
Hussain Nagaria
8f7638860f docs: remainder, image_to_base64, get_url, get_host_name*, get_link_to_report*, get_url_to_form 2023-12-18 21:55:55 +05:30
Hussain Nagaria
8d2137c265 docs: consistent doc strings 2023-12-18 18:27:39 +05:30
Hussain Nagaria
47626e96fb fix: type hint 2023-12-18 12:44:07 +05:30
Hussain Nagaria
837b6ff995 docs: generate_hash 2023-12-17 17:29:32 +05:30
Hussain Nagaria
db10004fe0 docs: markdown, to_markdown, md_to_html 2023-12-17 17:26:01 +05:30
Hussain Nagaria
93a5a60003 doc: get_url_to_list 2023-12-17 17:22:15 +05:30
Hussain Nagaria
e52b9049fd docs: get_absolute_url 2023-12-17 17:17:30 +05:30
Hussain Nagaria
b174224f21 docs: url_contains_port 2023-12-17 17:05:54 +05:30
Hussain Nagaria
6ff2023a20 docs: comma_sep 2023-12-17 17:02:42 +05:30
Hussain Nagaria
751e21bf73 docs: is_image, is_html, comma_or, comma_and, new_line_sep 2023-12-17 16:54:57 +05:30
Hussain Nagaria
f566b6cf4c docs: cstr 2023-12-17 16:36:25 +05:30
Hussain Nagaria
bd46a75aff docs: get_timespan_date_range 2023-12-17 15:49:34 +05:30
Hussain Nagaria
45c491228b docs: get_year_ending 2023-12-17 15:34:07 +05:30
Hussain Nagaria
10d34da769 docs: get_quarter_ending 2023-12-17 15:28:54 +05:30
Hussain Nagaria
20f99819d5 docs: typing overloads for get_year_start 2023-12-17 15:21:10 +05:30
Hussain Nagaria
3899c14b67 refactor: get_quarter_start returns current when dt is None 2023-12-17 14:54:59 +05:30
Hussain Nagaria
d0d78f65e9 docs: typing overloads for get_first_day_of_week/last_day_of_week 2023-12-17 14:48:45 +05:30
Hussain Nagaria
cdbe3555f6 fix: type hint 2023-12-17 14:43:30 +05:30
Hussain Nagaria
5e619db45a fix: words 2023-12-17 14:42:39 +05:30
Hussain Nagaria
3de84281a0 refactor: get_last_day_of_week supports as_str + docs 2023-12-17 14:41:47 +05:30
Hussain Nagaria
b42bcd5325 docs: get_first_day_of_week 2023-12-17 14:40:33 +05:30
Hussain Nagaria
73b7339163 doc: get_weekdays, get_weekday 2023-12-17 14:17:28 +05:30
Hussain Nagaria
6ffde4647b refactor: support str in get_weekday 2023-12-17 14:16:47 +05:30
Hussain Nagaria
d578c98b50 doc: get_datetime_str, get_date_str, get_time_str 2023-12-17 14:07:53 +05:30
Hussain Nagaria
b3d5db60fe docs: get_datetime_in_timezone and convert_utc_to_system_timezone 2023-12-17 13:17:05 +05:30
Hussain Nagaria
967755cb77 docs: nowtime 2023-12-17 12:52:09 +05:30
Hussain Nagaria
38fdf2d7cb docs: get_time 2023-12-17 12:47:39 +05:30
Hussain Nagaria
8156d24ec9 docs: get_abbr 2023-12-17 00:24:01 +05:30
Hussain Nagaria
ed36873af4 docs: get_system_timezone 2023-12-17 00:19:34 +05:30
Hussain Nagaria
d3cde6f743 chore: add type hints to get_eta 2023-12-17 00:17:18 +05:30