Skip to content

Commit

Permalink
Merge pull request #14 from MohmdFo/main
Browse files Browse the repository at this point in the history
feat(admin): Make folder type editable in admin and support dot in fo…
  • Loading branch information
sepehr-akbarzadeh authored Sep 8, 2024
2 parents f7b4201 + 23cb9e1 commit 01316c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sage_mailbox/admin/mailbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MailboxAdmin(admin.ModelAdmin):
(None, {"fields": ("name", "slug", "folder_type")}),
(_("Change Log"), {"fields": ("created_at", "modified_at")}),
)
readonly_fields = ("folder_type", "created_at", "modified_at")
readonly_fields = ("created_at", "modified_at")
actions = [delete_selected]

def get_readonly_fields(self, request, obj=None):
Expand Down
4 changes: 2 additions & 2 deletions sage_mailbox/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class FolderNameValidator:
"""

length_error_message = "Folder name must be between 1 and 255 characters long."
character_error_message = "Folder name contains invalid characters. Allowed characters are letters, numbers, underscore, and hyphen. Spaces are not allowed."
character_error_message = "Folder name contains invalid characters. Allowed characters are letters, numbers, underscore, hyphen, and dot. Spaces are not allowed."
code_length = "folder_name_length"
code_character = "folder_name_invalid_character"
regex = re.compile(r"^[\w-]+$")
regex = re.compile(r"^[\w.-]+$")

def __call__(self, value):
if not (1 <= len(value) <= 255):
Expand Down

0 comments on commit 01316c1

Please sign in to comment.