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

Fix #91: Add labels/badges on issues. #266

Merged
merged 1 commit into from
Jun 10, 2017
Merged

Fix #91: Add labels/badges on issues. #266

merged 1 commit into from
Jun 10, 2017

Conversation

jajodiaraghav
Copy link
Contributor

Fix #91

@souravbadami souravbadami self-assigned this Jun 9, 2017
Copy link
Collaborator

@souravbadami souravbadami left a comment

Choose a reason for hiding this comment

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

Hi @jajodiaraghav -- Looks great! I have left a few comments. Thanks!

(4, 'Security'),
(5, 'Typo'),
(6, 'Design'),
(0, 'Unspecified')
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about changing Unspecified to General ? I think, that will cover some of the bugs which doesn't comes under the predefined category.

<option value="4">Security</option>
<option value="5">Typo</option>
<option value="6">Design</option>
</select>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be rendered from the backend instead of hard coding the properties here. It'll guarantee a safe submission of our attribute integrity on both the sides.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Although I have rendered the form element in the edit page from the backend, I couldn't do it in base.html. I am new to Django and would love to see how to do this. Could you please change this part on top of my commit?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@jajodiaraghav -- What issue are you facing while using it in base.html ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

{{form.label}} does not render anything in base.html. I did it in a way similar to the one in issue_edit.html. It took me a lot of time trying to debug, but all in vain. Can we merge this and fix the base.html in a different commit. I want to work on issue_edit.html page but couldn't, as it would result in conflicts unless this gets merged.

Or else, please help me fix this.

Thanks :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Have a look at website/forms.py (IssueEditForm). The current implementation of the bug submission form needs a complete redesign. Maybe, we can do it completely on another PR.

<option value="5">Typo</option>
<option value="6">Design</option>
</select>

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ditto as the earlier comment.

@@ -6,7 +6,7 @@ class IssueEditForm(forms.ModelForm):

class Meta:
model = Issue
fields = ['description', 'screenshot']
fields = ['description', 'screenshot', 'label']
Copy link
Collaborator

Choose a reason for hiding this comment

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

It is a required element.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't get this part. Could be a bit more explicit?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can set the attributes of the form in the backend. So, if we declare a required clause within the form definition in the backend -- It'll make sure that it is required when it is rendered and thus form submission is declined if it is not filled. It also solves the problem that you asked on Slack.
https://docs.djangoproject.com/en/1.11/ref/forms/fields/#django.forms.Field.required

@souravbadami souravbadami changed the title Add labels/badges on issues Fix #91: Add labels/badges on issues. Jun 9, 2017
@souravbadami souravbadami merged commit 9253a79 into OWASP-BLT:master Jun 10, 2017
@jajodiaraghav jajodiaraghav deleted the feature_labels branch June 10, 2017 13:48
DonnieBLT pushed a commit that referenced this pull request Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants