Skip to content

Commit

Permalink
do not randomize action id
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-oleshkevich committed Apr 30, 2024
1 parent ef8877f commit de53c45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions ohmyadmin/actions/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
ActionVariant = typing.Literal["accent", "default", "text", "danger", "link", "primary"]


def random_slug() -> str:
return "action-{id}".format(id=random.randint(100_000, 999_999))


class Action:
icon: str = ""
label: str = ""
Expand Down Expand Up @@ -86,7 +82,7 @@ def __init__(
confirmation: str = "",
variant: ActionVariant = "default",
) -> None:
self.slug = random_slug()
self.slug = self.__class__.__name__.lower()
self.variant = variant
self.callback = callback
self.icon = icon or self.icon
Expand Down Expand Up @@ -136,7 +132,7 @@ def __init__(
modal_title: str = "",
modal_description: str = "",
) -> None:
self.slug = random_slug()
self.slug = self.__class__.__name__.lower()
self.callback = callback
self.modal_title = modal_title
self.modal_description = modal_description
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "ohmyadmin"
description = "Awesome admin panel for your business."
version = "0.5.3"
version = "0.5.4"
authors = ["Alex Oleshkevich <[email protected]>"]
license = "MIT"
readme = "README.md"
Expand Down

0 comments on commit de53c45

Please sign in to comment.