-
Notifications
You must be signed in to change notification settings - Fork 3
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
Comments and simplifications. #531
base: master
Are you sure you want to change the base?
Comments and simplifications. #531
Conversation
…string properties.
…_invalid if business rules are violated.
def condition_string(self) -> str: | ||
out: list[str] = [] | ||
""" | ||
Returns a string representation of the component conditions. | ||
|
||
components = self.components.latest_approved() | ||
This is the duty_sentence, if there is one measure, measure_type and additional_code or | ||
if there are more than one measure_type and additional_code. | ||
|
||
:dependencies: with_duty_sentence must be called in queries using this property. | ||
""" |
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.
Is this method even used anywhere? I've never really understood what it is meant to be showing?
|
||
components = self.components.latest_approved() |
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.
current()
would be better, to take account of any draft data.
if form.is_valid() and not self.form_violates(form): | ||
return self.form_valid(form) | ||
else: | ||
return self.form_invalid(form) |
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.
So instead of overriding form_valid (which also calls form_invalid) on TrackedModelChangeView
should we instead override the post call do you think?
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.
Probably - at the moment I was getting a load of test failures with this change, I need to get past.
Though, this may be another issue as since I re-setup my env again, I noticed I am getting them in plain master now :(
These are extra comments + simplifications found looking at TP2000-169, but that weren't actually part of that PR.
Currently encompasses comments for signposting (bits where I was wondering "what does this do and why") along possibly more controversial changes (stopping form_valid call form_invalid, which feels like an API violation).