mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 03:49:10 +02:00
Ensure publishing a layer already published does nothing
Just in case two users go to publish the same layer at around the same time, avoid saving the record for a user who tries to publishes it after the first time. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
eebbcf66c1
commit
f5e37e18c0
2
TODO
2
TODO
|
@ -6,8 +6,6 @@ TODO:
|
|||
|
||||
- we might consider adding a link to the all layers and all recipes tables from the layer details page
|
||||
|
||||
* Ensure publishing a published layer doesn't do anything
|
||||
|
||||
* Need an "About" section descriptibing what the site is for
|
||||
* Need an admin contact in footer
|
||||
* Some columns are a bit crushed
|
||||
|
|
|
@ -77,8 +77,9 @@ def publish(request, name):
|
|||
|
||||
def _statuschange(request, name, newstatus):
|
||||
w = get_object_or_404(LayerItem, name=name)
|
||||
w.change_status(newstatus, request.user.username)
|
||||
w.save()
|
||||
if w.status != newstatus:
|
||||
w.change_status(newstatus, request.user.username)
|
||||
w.save()
|
||||
return HttpResponseRedirect(reverse('layer_item', args=(name,)))
|
||||
|
||||
class LayerListView(ListView):
|
||||
|
|
Loading…
Reference in New Issue
Block a user