Closed
Bug 734395
Opened 13 years ago
Closed 13 years ago
Reset data_version in Balrog admin forms on submit
Categories
(Release Engineering :: General, defect)
Release Engineering
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: edransch, Assigned: bhearsum)
References
Details
Attachments
(1 file)
(deleted),
patch
|
nthomas
:
review+
bhearsum
:
checked-in+
|
Details | Diff | Splinter Review |
If a submitted form modifies the databases, it will change the data_value for the corresponding row.
When this happens, the form's stored data_value should be updated to reflect the new value, otherwise the user will have to reload the page each time they update a row of the database.
Assignee | ||
Comment 1•13 years ago
|
||
Attachment #609797 -
Flags: review?(nrthomas)
Comment 2•13 years ago
|
||
Comment on attachment 609797 [details] [diff] [review]
make put/post/delete methods return new_data_version in their response; update form elements on success
Review of attachment 609797 [details] [diff] [review]:
-----------------------------------------------------------------
::: auslib/db.py
@@ +717,5 @@
>
> + def getPermission(self, username, permission, transaction=None):
> + try:
> + row = self.select(where=[self.username==username, self.permission==permission], transaction=transaction)[0]
> + if row:
I'm curious why you wrote the code this way. Won't it fall straight through to the except if a non-empty array isn't returned by the select ? What does the 'if row' guard against ?
::: auslib/web/static/ausadmin.js
@@ +48,1 @@
>
I see you have a test for adding a permission returning new_data_version, but does addNewPermission() do the right thing with it on success ?
Attachment #609797 -
Flags: review?(nrthomas) → review+
Assignee | ||
Comment 3•13 years ago
|
||
Comment on attachment 609797 [details] [diff] [review]
make put/post/delete methods return new_data_version in their response; update form elements on success
Review of attachment 609797 [details] [diff] [review]:
-----------------------------------------------------------------
::: auslib/db.py
@@ +717,5 @@
>
> + def getPermission(self, username, permission, transaction=None):
> + try:
> + row = self.select(where=[self.username==username, self.permission==permission], transaction=transaction)[0]
> + if row:
Good point, I can't see a case where row would be empty.
::: auslib/web/static/ausadmin.js
@@ +48,1 @@
>
It does, in that it fetches the HTML for the entire row again (so that we don't have to duplicate that structure in JS):
).success(function(data) {
$.get(url, {'format': 'html'})
.error(handleError
).success(function(data) {
element.append(data);
});
});
So, it's not strictly necessary to return the data version for a new permission, I suppose.
Assignee | ||
Comment 4•13 years ago
|
||
Comment on attachment 609797 [details] [diff] [review]
make put/post/delete methods return new_data_version in their response; update form elements on success
Landed, with the superfluous 'if' removed. Jenkins run is here: https://jenkins.mozilla.org/job/Balrog/70/
Attachment #609797 -
Flags: checked-in+
Assignee | ||
Updated•13 years ago
|
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•11 years ago
|
Product: mozilla.org → Release Engineering
Updated•7 years ago
|
Component: General Automation → General
You need to log in
before you can comment on or make changes to this bug.
Description
•