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

URLField.gen_value doesn't return especially unique values #189

Closed
Ichimonji10 opened this issue Aug 27, 2015 · 1 comment
Closed

URLField.gen_value doesn't return especially unique values #189

Ichimonji10 opened this issue Aug 27, 2015 · 1 comment

Comments

@Ichimonji10
Copy link
Contributor

Method URLField.gen_value frequently generates identical values. As a result of this issue, several work-arounds have been added to module nailgun.entities. One example is at Media.create_missing:

    def create_missing(self):
        """Give the ``path_`` instance attribute a value if it is unset.

        By default, :meth:`nailgun.entity_fields.URLField.gen_value` does not
        return especially unique values. This is problematic, as all media must
        have a unique path.

        """
        if not hasattr(self, 'path_'):
            self.path_ = gen_url(subdomain=gen_alpha())
        return super(Media, self).create_missing()

Let's fix gen_url and drop the work-arounds from module nailgun.entities.

@Ichimonji10
Copy link
Contributor Author

#190 fixes this.

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

No branches or pull requests

1 participant