Skip to content

Commit

Permalink
feat: rename fields
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabh6790 committed May 30, 2024
1 parent 8d38cb3 commit dfca499
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
6 changes: 4 additions & 2 deletions press/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,13 @@ def _get_mariadb_root_password(self, site):
if database_server:
doctype = "Database Server"
name = database_server
field = "mariadb_root_password"
else:
doctype = "Managed Database Service"
name = managed_database_service
field = "root_user_password"

return get_decrypted_password(doctype, name, "mariadb_root_password")
return get_decrypted_password(doctype, name, field)

def _get_managed_db_config(self, site):
managed_database_service = frappe.get_cached_value(
Expand All @@ -123,7 +125,7 @@ def _get_managed_db_config(self, site):
return frappe.get_cached_value(
"Managed Database Service",
managed_database_service,
["database_host", "database_user", "port"],
["database_host", "database_root_user", "port"],
as_dict=1,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"database_section",
"service_provider",
"database_host",
"database_user",
"database_root_user",
"column_break_dboe",
"database_password",
"root_user_password",
"port",
"team_section",
"team"
Expand All @@ -33,24 +33,10 @@
"reqd": 1,
"unique": 1
},
{
"fieldname": "database_user",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Database User",
"reqd": 1
},
{
"fieldname": "column_break_dboe",
"fieldtype": "Column Break"
},
{
"fieldname": "database_password",
"fieldtype": "Password",
"in_list_view": 1,
"label": "Database Password",
"reqd": 1
},
{
"default": "3306",
"fieldname": "port",
Expand All @@ -73,11 +59,25 @@
"label": "Team",
"options": "Team",
"reqd": 1
},
{
"fieldname": "database_root_user",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Database Root User",
"reqd": 1
},
{
"fieldname": "root_user_password",
"fieldtype": "Password",
"in_list_view": 1,
"label": "Root User Password",
"reqd": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-05-29 17:17:13.481696",
"modified": "2024-05-29 19:11:14.644480",
"modified_by": "Administrator",
"module": "Press",
"name": "Managed Database Service",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class ManagedDatabaseService(Document):
from frappe.types import DF

database_host: DF.Data
database_password: DF.Password
database_user: DF.Data
database_root_user: DF.Data
port: DF.Data | None
root_user_password: DF.Password
service_provider: DF.Literal["AWS RDS"]
team: DF.Link
# end: auto-generated types
Expand Down
2 changes: 0 additions & 2 deletions press/press/doctype/site/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,6 @@ def update_config_preview(self):
"""Regenerates site.config on each site.validate from the site.configuration child table data"""
new_config = {}

new_config.update(self._get_managed_db_config())

# Update from site.configuration
for row in self.configuration:
# update internal flag from master
Expand Down

0 comments on commit dfca499

Please sign in to comment.