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

[feature] Allow shared subnets to have non shared child subnets #90 #92

Merged
merged 2 commits into from
Apr 17, 2021

Conversation

pandafy
Copy link
Member

@pandafy pandafy commented Mar 31, 2021

Closes #90

@pandafy pandafy requested a review from nemesifier March 31, 2021 14:54
@pandafy pandafy self-assigned this Mar 31, 2021
@pandafy pandafy added this to In progress in OpenWISP Priorities for next releases via automation Mar 31, 2021
@pandafy pandafy moved this from In progress to Ready for review/testing in OpenWISP Priorities for next releases Mar 31, 2021
Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

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

can you rebase on the current master and see my comment below?

organization_query = Q(organization_id=self.organization_id)
error_message = _('Subnet overlaps with {0}.')
if self.master_subnet:
if self.master_subnet.organization_id is None:
Copy link
Member

Choose a reason for hiding this comment

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

this works if there's only 1 level, but may not work if the master subnet does have an org set but has itself a relation to another master subnet which is shared, that's why in one of the validation checks below we iterate over all the master subnets

@coveralls
Copy link

coveralls commented Apr 4, 2021

Coverage Status

Coverage increased (+0.006%) to 99.387% when pulling 1e0ddf4 on ipaddress-admin-form-fix into d83d0d8 on master.

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

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

Tested and works. I am not sure it will work with nested master subnets, if you can check it would be great, if it doesn't work we can create an issue to deal with that later on.

Please fix the conflict and solve the issue highlighted in the comment below.

'will be automatically suggested in the ip address field'
)
except KeyError:
pass
Copy link
Member

Choose a reason for hiding this comment

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

this is causing the coverage to go down.

There should be a simpler way to redefine help_text of specific fields, please see: https://docs.djangoproject.com/en/3.1/topics/forms/modelforms/#overriding-the-default-fields
I hope you can use that method instead of this.

OpenWISP Priorities for next releases automation moved this from Ready for review/testing to In progress Apr 14, 2021
@pandafy
Copy link
Member Author

pandafy commented Apr 15, 2021

@nemesisdesign did you mean to test this?
image

Coverage seem to go down for unrelated reason.

@nemesifier
Copy link
Member

@nemesisdesign did you mean to test this?
image

Yes, does it work?
Is there a test for it?

Coverage seem to go down for unrelated reason.

Ok, let's ignore it now, I created an issue for this: #96

@pandafy
Copy link
Member Author

pandafy commented Apr 16, 2021

Is there a test for it?

I have added a test for it.

OpenWISP Priorities for next releases automation moved this from In progress to Reviewer approved Apr 17, 2021
Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

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

Thanks!

@nemesifier nemesifier merged commit aa0e946 into master Apr 17, 2021
OpenWISP Priorities for next releases automation moved this from Reviewer approved to Done Apr 17, 2021
@devkapilbansal devkapilbansal deleted the ipaddress-admin-form-fix branch April 18, 2021 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

[feature] Allow shared subnets to have non shared child subnets
3 participants