Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Bug 938184 - Don't allow creating groups while editing user profile #729

Closed
wants to merge 2 commits into from
Closed

Bug 938184 - Don't allow creating groups while editing user profile #729

wants to merge 2 commits into from

Conversation

dpoirier
Copy link
Contributor

Part of the changes for curated groups is that groups will only be
creatable from the groups list page, so only allow people editing
their profiles to select groups that already exist.

The tag-it library that was being used to implement the groups
selection could not easily be configured or modified to prevent
users from selecting non-existent items, so the groups field
was changed to use django-selectable. Styling was added to make
the django-selectable field look like the current tag-it fields,
which are still being used for e.g. skills and languages.

Part of the changes for curated groups is that groups will only be
creatable from the groups list page, so only allow people editing
their profiles to select groups that already exist.

The tag-it library that was being used to implement the groups
selection could not easily be configured or modified to prevent
users from selecting non-existent items, so the groups field
was changed to use django-selectable. Styling was added to make
the django-selectable field look like the current tag-it fields,
which are still being used for e.g. skills and languages.
@dpoirier
Copy link
Contributor Author

I just noticed helpers.py/stringify_groups is probably not needed anymore. I'll remove it.

@dpoirier
Copy link
Contributor Author

It turned out that stringify_groups is still used by skills. But I did spot some other unused code in forms.py and removed that.

@@ -161,18 +170,11 @@ def clean_groups(self):
consistent.

"""
if not re.match(r'^[a-zA-Z0-9 .:,-]*$', self.cleaned_data['groups']):
raise forms.ValidationError(_(u'Groups can only contain '
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, is it an intentional part of the new spec that groups are no longer restricted to alphanumeric ascii?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The autocomplete widget only allows existing groups to be selected, so we can't affect what names can be given to groups here.

We'll want to be sure the new page for creating curated groups does whatever validation of group names is needed, though.

@Sancus
Copy link
Contributor

Sancus commented Dec 3, 2013

merged manually into curatedgroups: ef9d0bd

Thanks! Closing this out.

@Sancus Sancus closed this Dec 3, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants