Skip to content
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

[Bug] Unexpected error when trying to approve service with duplicate short name #1781

Open
baszoetekouw opened this issue Jan 31, 2025 · 1 comment
Labels
discuss Needs to be discussed; do not implement as is.

Comments

@baszoetekouw
Copy link
Member

Description

Error should be handled more gracefully. And users should not be able to enter duplicate short name in the first place.

Bad news. An error occurred in Acceptatie at 2025-01-31 15:54 for user [email protected]:

Traceback (most recent call last):
  File "/opt/sbs/sbs-env/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/opt/sbs/sbs-env/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 941, in do_execute
    cursor.execute(statement, parameters)
  File "/opt/sbs/sbs-env/lib/python3.9/site-packages/MySQLdb/cursors.py", line 179, in execute
    res = self._query(mogrified_query)
  File "/opt/sbs/sbs-env/lib/python3.9/site-packages/MySQLdb/cursors.py", line 330, in _query
    db.query(q)
  File "/opt/sbs/sbs-env/lib/python3.9/site-packages/MySQLdb/connections.py", line 265, in query
    _mysql.connection.query(self, query)
MySQLdb.IntegrityError: (1062, "Duplicate entry 'cat' for key 'services_unique_abbreviation'")

Severity

None

Steps to Reproduce

  1. Create service request with short name identical to existing service
  2. Admin follows link for request mail
  3. Fill in an entityid and press "approve"

Expected Behavior

No response

Actual Behavior

No response

Screenshots or Logs

No response

Environment

No response

Additional Context

No response

@oharsta
Copy link
Collaborator

oharsta commented Feb 2, 2025

There is already a validation when registering an application if the short_name is duplicated.

Image

However there is no validation if an application is created if there is an unapproved application registration with the same short_name. What is the preferred behaviour? Proposal is to show an error indication in the approval of the service registration that the short_name is duplicated (e.g. taken in the time after the registration of the application).

@oharsta oharsta added the discuss Needs to be discussed; do not implement as is. label Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Needs to be discussed; do not implement as is.
Projects
Status: New
Development

No branches or pull requests

2 participants