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
fix: Duplicate entries allowed in Ticket-Tag #6351
fix: Duplicate entries allowed in Ticket-Tag #6351
Conversation
app/api/ticket_tags.py
Outdated
:param view_kwargs: | ||
:return: | ||
""" | ||
if self.session.query(TicketTag).filter_by(event_id=data['event'], name=data['name'], deleted_at=None).first(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be a possibility of ticket tags having the same name. Filtering by name might not be one of the best methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrsaicharan1 Yup, that's why I am using event_id
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prateekj117 Can't a single event have multiple tags with the same name? What about that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrsaicharan1 What'd be the usecase of that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iamareebjamal @prateekj117 Okay. Yeah, wouldn't have any advantage. This is fine.
Codecov Report
@@ Coverage Diff @@
## development #6351 +/- ##
===============================================
+ Coverage 65.38% 65.38% +<.01%
===============================================
Files 287 287
Lines 14725 14726 +1
===============================================
+ Hits 9628 9629 +1
Misses 5097 5097
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use unique contraint
96c7231
to
bdd02dd
Compare
@iamareebjamal Done. |
Fixes #6350
Short description of what this resolves:
It should check if the same ticket-tag already exists for the specified event.
Checklist
development
branch.