Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auto hostname #3884

Merged
merged 5 commits into from
Mar 3, 2025
Merged

Add auto hostname #3884

merged 5 commits into from
Mar 3, 2025

Conversation

hipek8
Copy link
Contributor

@hipek8 hipek8 commented Mar 3, 2025

No description provided.

Comment on lines +576 to +578
def assign_mgmt_hostname(self, *args, **kwargs):
return assign_management_hostname_and_ip(self, *args, **kwargs)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird but for a reason - if I added original action directly to actions list the the tests wouldn't work.
So if I did

actions = ["bulk_edit_action", "invoice_report", assign_management_hostname_and_ip]

I wouldn't be able to call

admin.assign_management_hostname_and_ip [...]

Weird but hope it is fixed in some future django version

Comment on lines +12 to +13
if not modeladmin.has_change_permission(request, obj=dca):
raise RuntimeError("insufficient permissions")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of mess with actions this action is visible for everyone so I guard here

@hipek8 hipek8 merged commit 24c2cfc into ng Mar 3, 2025
15 checks passed
@hipek8 hipek8 deleted the add_auto_hostname branch March 3, 2025 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants