Enforce uniqueness for all models

RESOLVED FIXED in 1.0

Status

Webtools Graveyard
Cesium
RESOLVED FIXED
8 years ago
a year ago

People

(Reporter: rdoherty, Assigned: jbalogh)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

8 years ago
Doesn't appear that our constraints for username, site url and page are being enforced.
(Assignee)

Comment 1

8 years ago
I don't see any constraints in the models.  What is it supposed to be?
(Reporter)

Comment 2

8 years ago
This was enforced with Sites.for_user, so we're good.
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
(Reporter)

Comment 3

8 years ago
f, no this wasn't.

Requirements:
-Username must be unique
-Site base url should be unique
-Page url + site_id should be unique
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Assignee)

Updated

8 years ago
Duplicate of this bug: 514318
(Assignee)

Comment 5

8 years ago
Created attachment 401598 [details] [diff] [review]
adding unique constraint for (page.url, page.site_id)
Attachment #401598 - Flags: review?(rdoherty)
(Assignee)

Updated

8 years ago
Assignee: nobody → jbalogh
(Reporter)

Comment 6

8 years ago
Comment on attachment 401598 [details] [diff] [review]
adding unique constraint for (page.url, page.site_id)

We need uniqueness in the db, but when a user adds a site and pages to track, we shouldn't show any errors if the site and pages exist already.

Currently errors are displayed when adding a site that already exists ("Site with this Base url already exists.")
Attachment #401598 - Flags: review?(rdoherty) → review-
(Assignee)

Comment 7

8 years ago
(In reply to comment #6)
> Currently errors are displayed when adding a site that already exists ("Site
> with this Base url already exists.")

I think that would be a different bug like "use page.get_or_create to make newish Pages".
(Reporter)

Comment 8

8 years ago
(In reply to comment #7)
> (In reply to comment #6)
> > Currently errors are displayed when adding a site that already exists ("Site
> > with this Base url already exists.")
> 
> I think that would be a different bug like "use page.get_or_create to make
> newish Pages".

wfm if you create the bug :)
(Reporter)

Updated

8 years ago
Attachment #401598 - Flags: review- → review+
(Assignee)

Comment 9

8 years ago
r52069
Status: REOPENED → RESOLVED
Last Resolved: 8 years ago8 years ago
Resolution: --- → FIXED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.