diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..dbfcf4527 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,28 @@ + +### Issue type: + + +**Python version:** +**NetBox version:** + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..4e9185a89 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,14 @@ + +### Fixes: + + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0ae5beb57..2a2b14446 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,84 +1,113 @@ ## Getting Help -If you encounter any issues installing or using NetBox, try one of the following resources to get assistance. Please -**do not** open an issue on GitHub except to report bugs or request features. - -### Freenode IRC - -Join the #netbox channel on [Freenode IRC](https://freenode.net/). You can connect to Freenode at irc.freenode.net using -an IRC client, or you can use their [webchat client](https://webchat.freenode.net/). +If you encounter any issues installing or using NetBox, try one of the +following resources to get assistance. Please **do not** open a GitHub +issue except to report bugs or request features. ### Mailing List -We have established a Google Groups Mailing List for issues and general discussion. You can find us [here]( https://groups.google.com/forum/#!forum/netbox-discuss). +We have established a Google Groups Mailing List for issues and general +discussion. This is the best forum for obtaining assistance with NetBox +installation. You can find us [here](https://groups.google.com/forum/#!forum/netbox-discuss). + +### Freenode IRC + +For real-time discussion, you can join the #netbox channel on [Freenode](https://freenode.net/). +You can connect to Freenode at irc.freenode.net using an IRC client, or +you can use their [webchat client](https://webchat.freenode.net/). ## Reporting Bugs * First, ensure that you've installed the [latest stable version](https://github.com/digitalocean/netbox/releases) of -NetBox. If you're running an older version, it's possible that the bug has already been fixed. +NetBox. If you're running an older version, it's possible that the bug +has already been fixed. * Next, check the GitHub [issues list](https://github.com/digitalocean/netbox/issues) to see if the bug you've found has -already been reported. If you think you may be experiencing a reported issue that hasn't already been resolved, please -click "add a reaction" in the top right corner of the issue and add a thumbs up (+1). You might also want to add a -comment describing how it's affecting your installation. This will allow us to prioritize bugs based on how many users -are affected. +already been reported. If you think you may be experiencing a reported +issue that hasn't already been resolved, please click "add a reaction" +in the top right corner of the issue and add a thumbs up (+1). You might +also want to add a comment describing how it's affecting your +installation. This will allow us to prioritize bugs based on how many +users are affected. -* If you haven't found an existing issue that describes your suspected bug, please inquire about it on IRC or Google Groups. -**Do not** file an issue until you have received confirmation that it is in fact a bug. Invalid issues are very -distracting and slow the pace at which NetBox is developed. +* If you haven't found an existing issue that describes your suspected +bug, please inquire about it on the mailing list. **Do not** file an +issue until you have received confirmation that it is in fact a bug. +Invalid issues are very distracting and slow the pace at which NetBox is +developed. -* When submitting an issue, please be as descriptive as possible. Be sure to include: +* When submitting an issue, please be as descriptive as possible. Be +sure to include: * The environment in which NetBox is running - * The exact steps that can be taken to reproduce the issue (if applicable) - * Any error messages returned + * The exact steps that can be taken to reproduce the issue (if + applicable) + * Any error messages generated * Screenshots (if applicable) -* Keep in mind that we prioritize bugs based on their severity and how much work is required to resolve them. It may -take some time for someone to address your issue. +* Keep in mind that we prioritize bugs based on their severity and how +much work is required to resolve them. It may take some time for someone +to address your issue. ## Feature Requests * First, check the GitHub [issues list](https://github.com/digitalocean/netbox/issues) to see if the feature you're -requesting is already listed. (Be sure to search closed issues as well, since some feature requests are rejected.) If -the feature you'd like to see has already been requested, click "add a reaction" in the top right corner of the issue -and add a thumbs up. This ensures that the issue has a better chance of making it onto the roadmap. Also feel free -to add a comment with any additional justification for the feature. (However, note that comments with no substance -other than a "+1" will be deleted as spam. Please use GitHub's reactions feature to indicate your support.) +requesting is already listed. (Be sure to search closed issues as well, +since some feature requests are rejected.) If the feature you'd like to +see has already been requested, click "add a reaction" in the top right +corner of the issue and add a thumbs up (+1). This ensures that the +issue has a better chance of making it onto the roadmap. Also feel free +to add a comment with any additional justification for the feature. +(However, note that comments with no substance other than a "+1" will be +deleted. Please use GitHub's reactions feature to indicate your +support.) -* While suggestions for new features are welcome, it's important to limit the scope of NetBox's feature set to avoid -feature creep. For example, the following features would be firmly out of scope for NetBox: +* While suggestions for new features are welcome, it's important to +limit the scope of NetBox's feature set to avoid feature creep. For +example, the following features would be firmly out of scope for NetBox: * Ticket management * Network state monitoring * Acting as a DNS server * Acting as an authentication server -* Before filing a new feature request, propose it on IRC or Reddit first. Feedback you receive there will help validate -and shape the proposed feature before filing a formal issue. +* Before filing a new feature request, consider raising your idea on the +mailing list first. Feedback you receive there will help validate and +shape the proposed feature before filing a formal issue. -* Good feature requests are very narrowly defined. Be sure to enumerate specific functionality and data schema. The more -effort you put into writing a feature request, the better its chances are of being implemented. Overly broad feature -requests will be closed. +* Good feature requests are very narrowly defined. Be sure to enumerate +specific functionality and data schema. The more effort you put into +writing a feature request, the better its chance is of being +implemented. Overly broad feature requests will be closed. -* When submitting a feature request on GitHub, be sure to include the following: +* When submitting a feature request on GitHub, be sure to include the +following: * A detailed description of the proposed functionality - * A use case for the feature; who would use it and what value it would add to NetBox - * A rough description of any changes necessary to the database schema - * Any third-party libraries or other resources which would be involved + * A use case for the feature; who would use it and what value it + would add to NetBox + * A rough description of changes necessary to the database schema + (if applicable) + * Any third-party libraries or other resources which would be + involved ## Submitting Pull Requests -* Be sure to open an issue before starting work on a pull request, and discuss your idea with the NetBox maintainers -before beginning work. This will help prevent wasting time on something that might we might not be able to implement. -When suggesting a new feature, also make sure it won't conflict with any work that's already in progress. +* Be sure to open an issue before starting work on a pull request, and +discuss your idea with the NetBox maintainers before beginning work. +This will help prevent wasting time on something that might we might not +be able to implement. When suggesting a new feature, also make sure it +won't conflict with any work that's already in progress. -* When submitting a pull request, please be sure to work off of the `develop` branch, rather than `master`. In NetBox, -the `develop` branch is used for ongoing development, while `master` is used for tagging new stable releases. +* When submitting a pull request, please be sure to work off of the +`develop` branch, rather than `master`. In NetBox, the `develop` branch +is used for ongoing development, while `master` is used for tagging new +stable releases. -* All code submissions should meet the following criteria (CI will enforce these checks): +* All code submissions should meet the following criteria (CI will +enforce these checks): * Python syntax is valid - * All tests pass when run with `./manage.py test netbox/` - * PEP 8 compliance is enforced, with the exception that lines may be greater than 80 characters in length + * All tests pass when run with `./manage.py test` + * PEP 8 compliance is enforced, with the exception that lines may be + greater than 80 characters in length diff --git a/netbox/dcim/forms.py b/netbox/dcim/forms.py index 1bcaa7a63..23cedae98 100644 --- a/netbox/dcim/forms.py +++ b/netbox/dcim/forms.py @@ -82,7 +82,7 @@ class RegionForm(BootstrapMixin, forms.ModelForm): # class SiteForm(BootstrapMixin, CustomFieldForm): - region = TreeNodeChoiceField(queryset=Region.objects.all()) + region = TreeNodeChoiceField(queryset=Region.objects.all(), required=False) slug = SlugField() comments = CommentField() @@ -1468,19 +1468,13 @@ class InterfaceConnectionForm(BootstrapMixin, forms.ModelForm): ] # Initialize rack_b choices if site_b is set - if self.is_bound and self.data.get('site_b'): - self.fields['rack_b'].queryset = Rack.objects.filter(site__pk=self.data['site_b']) - elif self.initial.get('site_b'): + if self.initial.get('site_b'): self.fields['rack_b'].queryset = Rack.objects.filter(site=self.initial['site_b']) else: self.fields['rack_b'].choices = [] # Initialize device_b choices if rack_b or site_b is set - if self.is_bound and self.data.get('rack_b'): - self.fields['device_b'].queryset = Device.objects.filter(rack__pk=self.data['rack_b']) - elif self.is_bound and self.data.get('site_b'): - self.fields['device_b'].queryset = Device.objects.filter(site__pk=self.data['site_b'], rack__isnull=True) - elif self.initial.get('rack_b'): + if self.initial.get('rack_b'): self.fields['device_b'].queryset = Device.objects.filter(rack=self.initial['rack_b']) elif self.initial.get('site_b'): self.fields['device_b'].queryset = Device.objects.filter(site=self.initial['site_b'], rack__isnull=True) @@ -1488,13 +1482,7 @@ class InterfaceConnectionForm(BootstrapMixin, forms.ModelForm): self.fields['device_b'].choices = [] # Initialize interface_b choices if device_b is set - if self.is_bound: - device_b_interfaces = Interface.objects.filter(device=self.data['device_b']).exclude( - form_factor__in=VIRTUAL_IFACE_TYPES - ).select_related( - 'circuit_termination', 'connected_as_a', 'connected_as_b' - ) - elif self.initial.get('device_b'): + if self.initial.get('device_b'): device_b_interfaces = Interface.objects.filter(device=self.initial['device_b']).exclude( form_factor__in=VIRTUAL_IFACE_TYPES ).select_related( diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 97cf27ec5..466fbd563 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -12,7 +12,7 @@ except ImportError: "the documentation.") -VERSION = '1.9.0' +VERSION = '1.9.0-r1' # Import local configuration for setting in ['ALLOWED_HOSTS', 'DATABASE', 'SECRET_KEY']: diff --git a/netbox/templates/circuits/provider.html b/netbox/templates/circuits/provider.html index 5465b8599..7c902fcd2 100644 --- a/netbox/templates/circuits/provider.html +++ b/netbox/templates/circuits/provider.html @@ -152,7 +152,7 @@