Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • PyI40AAS PyI40AAS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 48
    • Issues 48
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Aufgrund einer Storage Wartung wird GitLab zwischen 10 und 14:30 Uhr nicht oder nur teilweise zur Verfügung stehen. / Due to storage maintenance, GitLab will not be available or only partially available between 10am and 2:30pm.

  • Lehrstuhl für Informations- und AutomatisierungssystemeLehrstuhl für Informations- und Automatisierungssysteme
  • PyI40AASPyI40AAS
  • Merge requests
  • !79

model.base: fix id_short validation

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Leon Mauritz Möller requested to merge backport/id_short_validation into master Apr 27, 2021
  • Overview 0
  • Commits 1
  • Pipelines 3
  • Changes 2

This commit backports 445b1d8f from fix/id_short_validation (!78 (merged)).

In RegEx, the $ asserts the end of a string or line. When used in re.match() it asserts the end of the string by default, unless the last character is a newline symbol (\n). Then it asserts the end of the string before the newline. Thus the first regex check doesn't filter valid id_shorts ending in a newline, which it should. See https://docs.python.org/3.9/library/re.html#index-2

Using re.fullmatch() instead fixes this issue, making the ^ and $ unnecessary as well.

Next to adding a test for this behaviour this commit also simplifies the check for an alphabetical character at the start of the id_short. And although both checks could also be merged into one, they are left separate to be able to report more accurate errors.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: backport/id_short_validation