Skip to content

[Bug] [FE+BE] Inserting rules with an existing rule name fails. #4

@seongjinyoon

Description

@seongjinyoon

Issue Description:

I am encountering an issue while attempting to create a rewriting rule with case sensitive names. For example, if I create a rewriting rule named "Test" and another called "test", this causes a UNIQUE constraint error. This is due to the key being produced as '_'.join([word.lower() for word in str(rule['name']).split(' ')]) in rule_manager.py function rewrite_rule() where the key value is derived from the name of the rule.

Steps to Reproduce:

Go to Rewriting Rules tab and create or edit two queries with two identical names that are case sensitive (For example Test and test).

Error Message:

When creating the second rewriting rule, this error message should appear in the console and not add the second rule.
Screenshot 2023-08-04 at 3 59 24 PM

Proposed Solution:

The key attribute is redundant and is not being used by any queries inside our program. This issue can be solved by removing the key column as it will not affect any existing queries and the rule can still be identified through the attributes id and user_id

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions