Skip to content

Conversation

@rowan04
Copy link
Contributor

@rowan04 rowan04 commented Dec 18, 2025

  • Creates validator django app
  • Main validator page which accepts the input of an Apel record(s) and a record type (or all), and checks whether the record is valid or not.

Looks like:
image

Resolves GT-1190
Working towards #47

- base file template for the new message validator
- makes use of django app creator startapp
- within apps.py
- update config to have the correct name
- Linked into the Apel RecordFactory
- Doesn't make use of django model
- also cleans up some unnecessary code (unused exception handling)
- validation output is also kept on submission and refresh
- has to import the apel record type classes
- has an option for all, which uses the record header instead
- adds more comments
- reworks exception handling
- adds apel packages to requirements
- adds styling
- adds link to validator page onto home monitoring page
@rowan04
Copy link
Contributor Author

rowan04 commented Dec 18, 2025

Oh I didn't realise the stylesheet.css file didn't already exist on GitHub. What is the reason for this?

@tofu-rocketry tofu-rocketry self-assigned this Dec 18, 2025
@tofu-rocketry
Copy link
Member

Oh I didn't realise the stylesheet.css file didn't already exist on GitHub. What is the reason for this?

It exists in the publishing app, so you shouldn't need to re-include it. https://github.com/apel/monitoring/blob/4f17c53e16f0c9a58c39c36d3009fb792e2f4fc0/monitoring/publishing/static/stylesheet.css

}


def validate(record: str, record_type: str) -> str:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not keen on functions defined inside functions. Can this just go in the outer scope after the outer function?


<h2>Record Validator</h2>
<p><ul><li>
<a href="{% url 'validator' %}">{% url 'validator' %}</a> - A validating tool to check Apel records are
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<a href="{% url 'validator' %}">{% url 'validator' %}</a> - A validating tool to check Apel records are
<a href="{% url 'validator' %}">{% url 'validator' %}</a> - A validating tool to check APEL records are

@tofu-rocketry
Copy link
Member

See comments above. Also, can you rebase your branch please?

- move function definition out of other function
- sort out stylesheet location error
- fix APEL typo
@rowan04
Copy link
Contributor Author

rowan04 commented Dec 18, 2025

Oh I didn't realise the stylesheet.css file didn't already exist on GitHub. What is the reason for this?

It exists in the publishing app, so you shouldn't need to re-include it. https://github.com/apel/monitoring/blob/4f17c53e16f0c9a58c39c36d3009fb792e2f4fc0/monitoring/publishing/static/stylesheet.css

I did as I believe you meant but my own environment was being very weird (i have 2 static folders somehow and it keeps picking up the other one) so I'm not sure if this works as expected or not, can you double check please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants