Open-event-server: Cannot create ticket with name "Business Ticket" if former ticket with name "Business Ticket" was deleted

Created on 26 Nov 2019  Â·  17Comments  Â·  Source: fossasia/open-event-server

Cannot create ticket with name "Business Ticket" if former ticket with name "Business Ticket" was deleted. Error message appears.

High URGENT bug

All 17 comments

@iamareebjamal Isnt it duplicate of https://github.com/fossasia/open-event-server/issues/5871 ?

No

(psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "name_event_uc"
DETAIL:  Key (name, event_id)=(Business Ticket, 1170) already exists.

[SQL: UPDATE tickets SET name=%(name)s WHERE tickets.id = %(tickets_id)s]
[parameters: {'name': 'Business Ticket', 'tickets_id': 1265}]

Append -deleted to the ticket name when deleting. Similar to what we did in user email field

@iamareebjamal Shouldn't the ticket be deleted when we click remove ?

Why the id is still stored ?, Cant we do hard delete for tickets ?

@kushthedude I think there should be a log for everything in the database, so soft deletion method followed for deletion of tickets.

Tickets may be related to orders, so first of all, any ticket with placed order should not be able to be deleted, but this is another issue. Secondly, people make mistakes, and regarding events, tickets, and orders are the most important things related to an event in an event management system, so no, they shouldn't be hard deleted.

@iamareebjamal For this issue the name of ticket shall be changed inbeforedeleteobject method ? and also the permission has to be checked or not?

If it can be done in the same PR reliably, then great

@iamareebjamal I am stuck on beforedeleteibject method, I can't figure how to update the schema before the deletion, do i have to perform a db session transaction here or you can give me a example where it's done.

Or shall the saveToDb can be done after the ticket is deleted? which one will be appropriate?

I can't figure how to update the schema before the deletion

Why do you want to do that?

I can't figure how to update the schema before the deletion

Why do you want to do that?

Append -deleted to the ticket name when deleting. Similar to what we did in user email field

@iamareebjamal

@codedsun Please stick to one issue at a time.

@kushthedude At least he's sending PRs to urgent issues within a day

@codedsun It's not called updating the schema. It's updating DB, and see how it's done when deleting a user

@kushthedude - I love learning here and also this issue is not very major
one..I am working on it side by side..also as I am new to django, I will
take time to figure things out here.

Also, I am free all day and night, what else shall I do..

If you can want you can take this up. :)

On Wed, Nov 27, 2019, 10:27 PM Areeb Jamal notifications@github.com wrote:

@kushthedude https://github.com/kushthedude At least he's sending PRs
to urgent issues within a day

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/fossasia/open-event-server/issues/6621?email_source=notifications&email_token=AEYZISAZ2PJS2AKOYWR2WMLQV2RIVA5CNFSM4JR4XU3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFKENZY#issuecomment-559171303,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AEYZISFJUOIK5SZHA7XYKSDQV2RIVANCNFSM4JR4XU3A
.

Its great to hear from you, anyways I will be unavailable next week due to
end semester exams :( , Go ahead with the issues.

On Wed, 27 Nov, 2019, 22:30 Suneet Srivastava, notifications@github.com
wrote:

@kushthedude - I love learning here and also this issue is not very major
one..I am working on it side by side..also as I am new to django, I will
take time to figure things out here.

Also, I am free all day and night, what else shall I do..

If you can want you can take this up. :)

On Wed, Nov 27, 2019, 10:27 PM Areeb Jamal notifications@github.com
wrote:

@kushthedude https://github.com/kushthedude At least he's sending PRs
to urgent issues within a day

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<
https://github.com/fossasia/open-event-server/issues/6621?email_source=notifications&email_token=AEYZISAZ2PJS2AKOYWR2WMLQV2RIVA5CNFSM4JR4XU3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFKENZY#issuecomment-559171303
,
or unsubscribe
<
https://github.com/notifications/unsubscribe-auth/AEYZISFJUOIK5SZHA7XYKSDQV2RIVANCNFSM4JR4XU3A

.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/fossasia/open-event-server/issues/6621?email_source=notifications&email_token=AKQMTLV3R2HTAY7RIDWXK23QV2RTTA5CNFSM4JR4XU3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFKEXHI#issuecomment-559172509,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AKQMTLQO5WNHKLQIZWBLZN3QV2RTTANCNFSM4JR4XU3A
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Masquerade0097 picture Masquerade0097  Â·  3Comments

dr0pdb picture dr0pdb  Â·  4Comments

mariobehling picture mariobehling  Â·  4Comments

schedutron picture schedutron  Â·  4Comments

mariobehling picture mariobehling  Â·  4Comments