-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add description field to TrainingItems #523
Conversation
Renamed existing field to name, removed the dummy property.
Nice 👌🏻 |
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.
Looks good. Worth considering though. View full project report here.
PyRIGS/views.py
Outdated
object_name = re.sub(r'[^a-zA-Z0-9 \n\.]', '', obj.name) | ||
|
||
context = { | ||
'object': obj, | ||
'current_user': self.request.user, | ||
'object_name': object_name, | ||
'info_string': f"[Paperwork generated {user_str}on {time} - {obj.current_version_id}]", | ||
'info_string': get_info_string(self.request.user) + "- {obj.current_version_id}]", |
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.
'info_string': get_info_string(self.request.user) + "- {obj.current_version_id}]", | |
'info_string': get_info_string(self.request.user) + f"- {obj.current_version_id}]", |
If this was meant to be f-string then f
prefix is missing. More info.
PyRIGS/views.py
Outdated
class PrintListView(generic.ListView): | ||
def get_context_data(self, *args, **kwargs): | ||
context = super().get_context_data(*args, **kwargs) | ||
context['current_user'] = self.request.user, |
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.
context['current_user'] = self.request.user, | |
context['current_user'] = self.request.user |
It looks like None
should not be a tuple? The comma after the value makes it a tuple. Explained here.
training/views.py
Outdated
|
||
def get_context_data(self, **kwargs): | ||
context = super().get_context_data(**kwargs) | ||
context['filename'] = f"TrainingItemList.pdf" |
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.
context['filename'] = f"TrainingItemList.pdf" | |
context['filename'] = "TrainingItemList.pdf" |
f-string is unnecessary here. This can just be a string. Read more.
Also adds the ability to export the training item list to a PDF. WIP.