opened
u1735067
username_0
<!--
    NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED.

    This form is only for reporting reproducible bugs. If you need assistance
    with Nautobot installation, or if you have a general question, please start a
    discussion instead: https://github.com/nautobot/nautobot/discussions

    Please describe the environment in which you are running Nautobot. Be sure
    that you are running an unmodified instance of the latest stable release
    before submitting a bug report, and that any plugins have been disabled.
-->
### Environment
* Python version: 3.6
* Nautobot version: 1.0.2

<!--
    Describe in detail the exact steps that someone else can take to reproduce
    this bug using the current stable release of Nautobot. Begin with the
    creation of any necessary database objects and call out every operation
    being performed explicitly. If reporting a bug in the REST API, be sure to
    reconstruct the raw HTTP request(s) being made: Don't rely on a client
    library such as pynautobot.
-->
### Steps to Reproduce
1. Create Git repo with /export_templates/ipam/vlan/html_export.html export template
2. Add Git repo in Nautobot
3. Launch (or relaunch) sync

<!-- What did you expect to happen? -->
### Expected Behavior
Template is imported and kept

<!-- What happened instead? -->
### Observed Behavior
Template is imported and then immediately removed, in log we can observe: 
```
worker_1 | 11:52:36.095 INFO nautobot.datasources.git :
worker_1 | Loading `ipam.vlan` export template from `text_export.html`
worker_1 | 11:52:36.179 INFO nautobot.datasources.git :
worker_1 | Successfully created export template
worker_1 | 11:52:36.190 WARNING nautobot.datasources.git :
worker_1 | Deleted export template [GitLab] ipam | VLAN: text_export.html
```

This seems to be caused by https://github.com/nautobot/nautobot/blob/v1.0.2/nautobot/extras/datasources/git.py#L694, where `template_record.content_type.name` (=`VLAN`) is used instead of `template_record.content_type.model` (=`vlan`), may I submit a PR with this change?
Git imported template immediately removed during import
issue
created
glennmatthews
username_1
Thank you for the report and for the analysis! I agree with your analysis; please do feel free to submit a PR that fixes this and adds an appropriate unit test covering this issue.
comment
created
u1735067
username_0
While I have a PR ready for the fix, I don't have the tests parts and cannot work on it until maybe wednesday because of workstation lacking ressources for another dev environment, so I'll then look into it, if you haven't already completed it by this time.
comment
closed
glennmatthews
username_1
issue