question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Input validation - forbid using double-quote char '"'

See original GitHub issue

Environment

  • Python version: N/A
  • Nautobot version: N/A

Proposed Functionality

When using .csv data the char ‘"’ (double quote) will be used as a string delimiter. This leads to an error when trying to import the exported data.

Additionally a conversion of char " to char ' (single quote) should be implemented, so importing an exported file will not lead to an error.

Use Case

Allow importing a previously exported .csv file when data contains a " character

Database Changes

None

External Dependencies

None

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jathanismcommented, Apr 28, 2021

@glennmatthews Wrong issue, I think I’ve used an external created racks.csv file instead of the exported one. It contains data that did not escape the " char correctly as "".

But I noticed that the field type will be exported as 4-post cabinet but for import the value 4-post-cabinet is required. Also the status field contains the value Active but must be imported as active.

exported Racks data:

site,group,name,facility_id,tenant,status,role,type,serial,asset_tag,width,u_height,desc_units,outer_width,outer_depth,outer_unit,comments
DEBE,Racks-DEBE,Rack-1,Schrank-1_1-Stock_DEBE,ACME-DEBE,Active,,4-post cabinet,,,19,42,,,,,"### Schrank-1 1. Stock""

**Wartung (Office):**

- Jane Doe

mail: jane.doe@example.com"

Ok this is definitely a bug and appears to be related to if not the same issue as #254 in that what is exported doesn’t match the format of what is required for import. As far as I’m concerned this is not desirable user experience. Import/export should be identical.

0reactions
glennmatthewscommented, Dec 21, 2021

I’m going to close this as a specific instance of the more general problem described by #254.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best way to forbid quotation marks on input - Stack Overflow
Let's assume I have an <input> tag. Value of this tag is used on change. The problem is that if a user inputs...
Read more >
"Check for forbidden characters" check throws false positives ...
"Check for forbidden characters" check throws false positives with straight double quotes: glitch or intended operation?
Read more >
What's the best way to create a validation rule on 'Account ...
Test it out in Rubular. ... Your validation rule would then be: Escape single quotes: REGEX(Name, ". ... Escape single or double quotes:...
Read more >
Input Validation - OWASP Cheat Sheet Series
Free-form text, especially with Unicode characters, is perceived as difficult to validate due to a relatively large space of characters that need to...
Read more >
Data Validation: Special characters that must be escaped
If there is a \ character within the field, it must be escaped by enclosing it within a set of double quotation marks....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found