Skip to content

Commit

Permalink
Rename secret util to pg_service_file
Browse files Browse the repository at this point in the history
  • Loading branch information
boardend committed May 22, 2024
1 parent 29c2f68 commit 19adca0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docker-app/qfieldcloud/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
)
from qfieldcloud.core.paginators import LargeTablePaginator
from qfieldcloud.core.templatetags.filters import filesizeformat10
from qfieldcloud.core.utils2 import delta_utils, jobs, secret
from qfieldcloud.core.utils2 import delta_utils, jobs, pg_service_file
from rest_framework.authtoken.models import TokenProxy

admin.site.unregister(LogEntry)
Expand Down Expand Up @@ -616,14 +616,14 @@ def clean(self):
value = cleaned_data.get("value")
if value:
try:
secret.validate_pg_service_conf(value)
pg_service_file.validate_pg_service_conf(value)
except ValidationError as err:
raise ValidationError({"value": err.message})

# ensure name with PGSERVICE_SECRET_NAME_PREFIX
name = cleaned_data.get("name")
if name and not name.startswith(secret.PGSERVICE_SECRET_NAME_PREFIX):
cleaned_data["name"] = f"{secret.PGSERVICE_SECRET_NAME_PREFIX}{name}"
if name and not name.startswith(pg_service_file.PGSERVICE_SECRET_NAME_PREFIX):
cleaned_data["name"] = f"{pg_service_file.PGSERVICE_SECRET_NAME_PREFIX}{name}"

return cleaned_data

Expand Down

0 comments on commit 19adca0

Please sign in to comment.